【发布时间】:2016-04-01 00:50:42
【问题描述】:
我正在尝试在电子应用程序中使用 vue.js,但出现以下错误:
未捕获的异常:ReferenceError:文档未定义 在查询(/Users/LM/Documents/mongoui/node_modules/vue/dist/vue.common.js:1070:10) 在 Vue._initProps (/Users/LM/Documents/mongoui/node_modules/vue/dist/vue.common.js:7254:23) 在 Vue._initState (/Users/LM/Documents/mongoui/node_modules/vue/dist/vue.common.js:7235:10) 在 Vue._init (/Users/LM/Documents/mongoui/node_modules/vue/dist/vue.common.js:2394:10) 在新的 Vue (/Users/LM/Documents/mongoui/node_modules/vue/dist/vue.common.js:9000:8) 在对象。 (/Users/LM/Documents/mongoui/main.js:11:1) 在 Module._compile (module.js:425:26) 在 Object.Module._extensions..js (module.js:432:10) 在 Module.load (module.js:356:32) 在 Function.Module._load (module.js:313:12)
这就是我在main.js 中加载 vue.js 的方式:
var Vue = require('vue');
new Vue({
el: "#app",
data: {
collections: [
{"name": "test 1"},
{"name": "test 2"},
{"name": "test 3"}
]
}
});
【问题讨论】:
标签: electron