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

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

<a href='mailto:'>微wx笑</a>的头像微wx笑 2021-01-12前端开发 2 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.SOQ无知人生


SOQ无知人生

found inSOQ无知人生


SOQ无知人生

---> <List> at src/views/cmscategory/list.vueSOQ无知人生

       <AppMain> at src/layout/components/AppMain.vueSOQ无知人生

         <Layout> at src/layout/index.vueSOQ无知人生

           <App> at src/App.vueSOQ无知人生

             <Root>SOQ无知人生


SOQ无知人生

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

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

本文由 微wx笑 创作,采用 CC BY-NC 4.0 许可协议。 非商业性使用可自由转载、引用、甚至修改,但需署名作者且注明出处。

很赞哦! () 有话说 ()