我使用的是webpack
,在chrome中构建并运行后显示了这个错误,我不知道如何解决它。
我的代码非常简单:
{
"devDependencies": {
"babel-core": "^6.23.1",
"babel-loader": "^6.3.2",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.22.0",
"babel-runtime": "5",
"css-loader": "^0.26.1",
"html-webpack-plugin": "^2.28.0",
"vue-hot-reload-api": "^2.0.9",
"vue-html-loader": "^1.2.3",
"vue-loader": "10.0.3",
"vue-style-loader": "^2.0.0",
"vue-template-compiler": "^2.1.10",
"webpack": "^2.2.1",
"webpack-dev-server": "^2.4.1"
},
"dependencies": {
"vue": "^2.1.10"
}
}
发布于 2017-02-20 20:21:23
Vue是该库的默认导出,因此您可以像这样导入。
import Vue from 'vue'
发布于 2018-07-31 04:10:57
您需要导入仅运行时构建。This comment in the Github issues解释道。
把这个放到你的webpack.config.js
里。
resolve: {
alias: {
vue: 'vue/dist/vue.js'
}
}
https://stackoverflow.com/questions/42343778
复制相似问题