[Vue warn]: Templates should only be responsible for mapping the state to the UI

出现这个警告的原因可能是你新建VUE实例的代码放在了被绑定的组件当中

比如

<div id='list'>

<ul v-for='li in data'>
<li></li>

</ul>

<script>
var vm=new Vue({
el:'#list',//因为创建实例的代码放在了#list这个模块当中,导致的错误,把这段代码放在list模块之外即可
data:data

})

</script>
</div>

猜你喜欢

转载自blog.csdn.net/hiliqi/article/details/80375577
今日推荐