vue-提示warning
[Vue warn]: Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>.出现这个警告的原因可能是你新建VUE实例的代码放在了被绑定的组件当中比如<div id='
·
[Vue warn]: Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>.
出现这个警告的原因可能是你新建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>
更多推荐
已为社区贡献15条内容
所有评论(0)