yun 发布的最佳帖子
main.js代码如下:
let e = engines.execScriptFile("./script/newScript.js", {
delay: 3000,
path: "./script/",
})
sleep(1000)
log(e.getEngine());
newScript.js代码如下:
events.broadcast.on("startRun", ()=>{toastLog("开始运行")})
setTimeout(()=>{
log(require("common"))
},3000)
运行后报错内容如下:
文件目录结构:
- assets
- script
- common.js
- newScript.js
- project.json
- main.js