js require 动态加载 变量目录的js数据。

                    var temp = that.wordRow[this.wordRowIdx] ;
                    //import(mdPath).then((m)=>{
                    /*
                    import("@/data/exec/a.js").then((m)=>{
                        console.log(m.default)
                        that.execInfo = m.default;
                        that.curTopic = that.execInfo.topics[that.curStep];
                    })
                    */
                   that.execInfo = require(`@/data/exec/${temp}.js`).default;
                   console.log( JSON.stringify(that.execInfo) )
                   that.curTopic = that.execInfo.topics[that.curStep];

你可能感兴趣的:(js require 动态加载 变量目录的js数据。)