問題
開發(fā)微信小程序的時候報錯報錯 Cannot read property ‘name‘ of undefined TypeError,應該怎么解決
分析原因
在引用微信小程序組件時,聲明 properties 屬性時需要聲明其屬性類型。
在查看微信小程序文檔有說到。
解決方案
超簡單,只需補充 屬性的 type就可以了。文章來源:http://www.zghlxwxcb.cn/article/412.html
properties: { isshow: false, },
修改為文章來源地址http://www.zghlxwxcb.cn/article/412.html
properties: { isshow: { type: Boolean, value: false }, },
到此這篇關(guān)于Cannot read property ‘name‘ of undefined TypeError的文章就介紹到這了,更多相關(guān)內(nèi)容可以在右上角搜索或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!