What's wrong with webpack packaging and running vue program?
Solution:
According to the error display, we know that it is a runtime-only problem
. The code in runtime-only does not allow template to exist
. The code in runtime-compiler can have template because the compiler can be used to compile the template.
Change runtime-only to runtime- The compiler is OK
. There is a compiler in vue.esm.js, so you can change the configuration
. Configure a property resolve in webpack.cofing.js
resolve:{
alias:{
'vue$':'vue/dist/vue.esm.js'
}
}