为什么报错改正他!DOCTYPE htmlhtml lang=enhead meta charset=UTF-8 title选项卡切换效果title meta http-equiv=X-UA-Compatible content=IE=edge meta name=viewport content=width=device-width initial-scale=10
报错原因:代码中使用了未加引号的模板字符串。
修改方法:将组件的模板字符串改为用单引号或双引号包裹起来的字符串即可。例如:
template: '<div class="main"><div v-for="(movie, index) in movies"><span>{{ index + 1 }}</span><span>{{ movie.name }}</span><span>{{movie.star}}</span><button @click="removeMovie(index)" >删除</button></div></div>'
原文地址: https://www.cveoy.top/t/topic/0od 著作权归作者所有。请勿转载和采集!