前端开发您现在的位置是:首页 > 博客日志 > 前端开发

Property or method "id" is not defined on the instance but referenced during render.

<a href='mailto:'>微wx笑</a>的头像微wx笑 2021-01-12前端开发 4 0关键字: element  el-table  property  

[Vue warn]: Property or method "id" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data op

[Vue warn]: Property or method "id" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.n8f无知


n8f无知

found inn8f无知


n8f无知

---> <List> at src/views/cmscategory/list.vuen8f无知

       <AppMain> at src/layout/components/AppMain.vuen8f无知

         <Layout> at src/layout/index.vuen8f无知

           <App> at src/App.vuen8f无知

             <Root>n8f无知


n8f无知

el-table 指定 row-key的时候,使用“:row-key="id"”的时候就会出现些错误,这时它会认为“id”是一个变量或方法,而我没有定义;n8f无知

我为什么要使用“:row-key="id"”呢?因为不加冒号的时候,id字段本身是数字类型,它会默认给转换为字符串类型。n8f无知

本文由 微wx笑 创作,采用 署名-非商业性使用-相同方式共享 4.0 许可协议,转载请附上原文出处链接及本声明。
原文链接:https://www.ivu4e.cn/blog/front/2021-01-12/602.html

很赞哦! () 有话说 ()