1.blade文件代码如下:
2.js代码如下:
3.vue文件代码如下:
4.最后面报错如下:
[Vuewarn]:Youareusingtheruntime-onlybuildofVuewherethetemplatecompilerisnotavailable.Eitherpre-compilethetemplatesintorenderfunctions,orusethecompiler-includedbuild.(foundin)
请大神解答,百度了很久都没找到问题,代码全部仔细看了一遍也没找到问题,跪求解答,谢谢!!!
话说你都是使用webpack来编译打包vue文件了吧?为啥还要把#app
的模版放在blade
模版中?
有两种解决方法:
第一种:使用非esm版本的vue--把webpack配置文件(如webpack.base.conf.js)中的
vue$`的alias
干掉
resolve:{alias:{'vue$':'vue/dist/vue.esm.js',//-->这一行注释掉//...}}
然后重新构建应该就OK了。
第二种:把blade中的#app的内容拷贝出来,放到newVue({el:'#app'})
中的template位置,比如:
newVue({el:'#app',//把blade中的#app的内容拷贝到template中:template:`<divid="app"><ulclass="list-group"><step-listv-for="stepininProcess"v-bind:step="step"></step-list></ul></div>`,//...})