vue中报错Do not use built-in or reserved HTML elements as component id details

原因是定义了一个叫做details的comonent
跟现有的html网页中的标签重合

export default {
  name: 'details',
  data () {
    return {
      equityBalance: this.item.equityData,
      depositWithdraw: this.item.depositWithdraw,
      symbol: 3,
      //真实的出金记录
      withdrawData: {},
      //真实的入金记录
      depositData: {}
    };
  }
}

组件,不能和html标签重复

details组件,h5新标签重复

由于在模板需要插入到 DOM 中,所以模板中的标签名必须能够被 DOM 正确地解析。主要有三种情况:

一是完全不合法的标签名,例如 </>;

二是与 HTML 元素重名会产生不确定的行为,例如使用 input 做组件名不会解析到自定义组件,使用 button 在 Chrome 上正常但在 IE 上不正常;

三是与 Vue 保留的 slot、partial、component 重名,因为会优先以本身的意义解析,从而产生非预期的结果。

解决办法:

办法1: 如果我们采用正确命名,并对应修改上述代码,将details改正,即可消除报错。
办法2: 也可以直接删除name 属性。

站在巨人的肩膀上摘苹果:

https://blog.csdn.net/qq_35393869/article/details/80364951

https://www.cnblogs.com/qingqingzou-143/p/7068514.html

原文地址:https://www.cnblogs.com/eternityz/p/12272506.html

时间: 2024-07-29 16:12:32

vue中报错Do not use built-in or reserved HTML elements as component id details的相关文章

vue 渲染是出现 Do not use built-in or reserved HTML elements as component id 的警告

是因为组件命名和引入不一致造成的. 命名组件(nav) export default { name: 'nav', data () { return { } } 引入组件(Navigation) import Mnav from './common/Navigation' 改成一致后可解决该问题. 命名组件(Navigation) export default { name: 'Navigation', data () { return { } } 原文地址:https://www.cnblog

vue Do not use built-in or reserved HTML elements as component id: nav

刚入坑vue 在新建组建的时候出现这个问题,原因是我新建的这个组建name: 'nav' 在vue中好像nav 这样的 有点类似于 "关键字" 不能作为组建的name,按照服务端来说 就是不可以命名关键字 为你的属性名一样的意思 所以在vue中 比如 nav ,header,footer 不可以作为组建的name 否则会出现这个问题. <script> export default { name: 'mynav',//不可命名为nav header footer 等 dat

[Vue warn]: Do not use built-in or reserved HTML elements as component id: header

因为header在HTML5里面是个原生的标签,所以在开发的时候会提示错误,解决方法:修改components里面左边的header

vue中报错: * zrender/lib/contain/line in ./node_modules/[email&#160;protected]@echarts/lib/cha

1.报错背景:之前一切正常,然后项目需要上传到svn上,我把写好的项目换了个位置,上传.运行,结果竟然报了 361个错!!! 项目中使用了echarts,报错信息如下: ERROR Failed to compile with 361 errors 11:34:57 These dependencies were not found: * zrender/lib/contain/line in ./node_modules/[email protected]@echarts/lib/chart/

vue中报错Props with type Object/Array must use a factory function to return the default value

Invalid default value for prop "value": Props with type Object/Array must use a factory function to return the default value.(props default 数组/对象的默认值应当由一个工厂函数返回) 正确书写方式 <script> export default{ props:{ list:{ type: [Object,Array], default:

VUE - vue.runtime.esm.js?6e6d:619 [Vue warn]: Do not use built-in or reserved HTML elements as component i

<script> export default { name:'header'       //  不要使用内置或保留的HTML元素 , 改为Header或者置或保留的HTML元素之外的名称就好了 } </script> 原文地址:https://www.cnblogs.com/500m/p/11780472.html

vue报错 Module not found: Error: Cannot resolve &#39;file&#39; or &#39;directory&#39;

炸了,我好写sell而组件,直接就用了,我的天哪 看你的写了吗,就用: Module not found: Error: Cannot resolve 'file' or 'directory' 页另一种错误,按这种情况我没遇到:http://www.mamicode.com/info-detail-1564042.html vue报错 Module not found: Error: Cannot resolve 'file' or 'directory'

tcpSrv在vs2008中报错

报错内容: 1>LINK : warning LNK4076: 无效的增量状态文件“F:\VC_proj\Cproj\Debug\Cproj.ilk”:正在非增量链接1>lase.obj : error LNK2028: 无法解析的标记(0A000013) "extern "C" int __stdcall closesocket(unsigned int)" ([email protected]@[email protected]),该标记在函数 &q

MySql中报错:java.sql.SQLException: Incorrect string value: &#39;\xF0\x9F\x90\xBB&#39; for column

问题描述: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x90\xBB' for column 'nickName' at row 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1094) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4226) at com.mysql.jdbc.M