[Vue warn]: Error in callback for watcher 「lists「: 「TypeError: Cannot read property ‘length‘ of unde

[Vue warn]: Error in callback for watcher 「lists」: 「TypeError: Cannot read property ‘length’ of undefined」 原因是 props父傳子 的時候, 父組件data中 初始化的值是{},但是子組件接收的時候,初始化是[] 父組件: 子組件: 消除警告的辦法是: 父組件 加上這個[]
相關文章
相關標籤/搜索