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 11{
22 "name" : " vue-docgen-api" ,
3- "version" : " 2.0.10 " ,
3+ "version" : " 2.0.11 " ,
44 "description" : " Toolbox to extract information from Vue component files for documentation generation purposes." ,
55 "bugs" : {
66 "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) {
4848const evalComponentCode = ( code ) => {
4949 try {
5050 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+ }
5165 const sandbox = {
5266 exports : { } ,
5367 Vue : {
@@ -58,17 +72,7 @@ const evalComponentCode = (code) => {
5872 exports : {
5973 } ,
6074 } ,
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 ,
7276 document : { } ,
7377 window : {
7478 location : { } ,
Original file line number Diff line number Diff line change 22</template >
33<script >
44 import {mapGetters } from ' vuex'
5+ const ctx = require .context (' some/path' , true , / . jpg$ / );
6+
57 /**
68 * Partial mapping, object spread operator example
79 */
You can’t perform that action at this time.
0 commit comments