这个Vue warn是什么意思?

这个Vue warn是什么意思?

[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 <style>. 
[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>. 
阅读 30k
5 个回答

我出现这种报错的原因是因为,我在标签内用了v-for,html标签嵌套少了闭合标签导致的。可以检查下html是不是嵌套出错了。

可能是你的组件标签没有闭合,比如<div>后面连接的不是</div> 。

就是一些警告。告诉你script和style不在解析范围内。把这部分代码分离出去试试

是template的结构有问题,可能缺少外包围的标签

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

`<div id='app1'>
<a>aaaa</a>
<div id=app2>
    <a>bbbb</a>
</div></div>`
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题