报错:
You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
解决:
webpack.config.js
添加如下配置
resolve: {
alias: {
vue: 'vue/dist/vue.js'
}
}
或者
import vue from 'vue/dist/vue.js';
原因:
vue默认配置的是runtime版本。