纳速健身

标题: vue报错警告Error compiling template Avoid placing tags with side-effects in your templates, such as <script> ,<script>标签必须在<div id="app"></div>之外 [打印本页]

作者: awagink    时间: 2021-2-21 11:23
标题: vue报错警告Error compiling template Avoid placing tags with side-effects in your templates, such as <script> ,<script>标签必须在<div id="app"></div>之外
vue报错警告,
  1. [Vue warn]: Error compiling template:

  2. Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed.
复制代码


原因为<script>标签必须在<div id="app"></div>之外。在内部会报错。

================================
(, 下载次数: 4)
vue报错警告,
[code][Vue warn]: Error compiling template:

Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as

原因:
原因是你新建VUE实例的代码放在了被绑定的组件
,将’<‘script>标签写到’<div id="app"></div>’之外。








欢迎光临 纳速健身 (https://www.nasue.com/) Powered by Discuz! X3.4