This repository was archived by the owner on Mar 8, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +18
-12
lines changed Expand file tree Collapse file tree 3 files changed +18
-12
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-docgen-api" ,
3
- "version" : " 2.0.10 " ,
3
+ "version" : " 2.0.11 " ,
4
4
"description" : " Toolbox to extract information from Vue component files for documentation generation purposes." ,
5
5
"bugs" : {
6
6
"url" : " https://github.com/vue-styleguidist/vue-docgen-api/issues"
Original file line number Diff line number Diff line change @@ -48,6 +48,20 @@ function getMixins(code, file) {
48
48
const evalComponentCode = ( code ) => {
49
49
try {
50
50
const script = new vm . Script ( code , { } ) ;
51
+ let requireSanbox = function ( element ) {
52
+ if ( element === 'vuex' ) {
53
+ return {
54
+ mapState : function ( ) { } ,
55
+ mapMutations : function ( ) { } ,
56
+ mapGetters : function ( ) { } ,
57
+ mapActions : function ( ) { }
58
+ }
59
+ }
60
+ return function ( ) { }
61
+ }
62
+ requireSanbox . context = function ( ) {
63
+ return function ( ) { }
64
+ }
51
65
const sandbox = {
52
66
exports : { } ,
53
67
Vue : {
@@ -58,17 +72,7 @@ const evalComponentCode = (code) => {
58
72
exports : {
59
73
} ,
60
74
} ,
61
- require :( element ) => {
62
- if ( element === 'vuex' ) {
63
- return {
64
- mapState : function ( ) { } ,
65
- mapMutations : function ( ) { } ,
66
- mapGetters : function ( ) { } ,
67
- mapActions : function ( ) { }
68
- }
69
- }
70
- return function ( ) { }
71
- } ,
75
+ require :requireSanbox ,
72
76
document : { } ,
73
77
window : {
74
78
location : { } ,
Original file line number Diff line number Diff line change 2
2
</template >
3
3
<script >
4
4
import {mapGetters } from ' vuex'
5
+ const ctx = require .context (' some/path' , true , / . jpg$ / );
6
+
5
7
/**
6
8
* Partial mapping, object spread operator example
7
9
*/
You can’t perform that action at this time.
0 commit comments