您当前的位置: 首页 > 技术文章 > 前端开发

[Vue warn]: Avoid adding reactive properties to a Vue instance or its root $data at runtime - declar

作者: 时间:2023-12-03阅读数:人阅读

报错详情图:

[Vue warn]: Avoid adding reactive properties to a Vue instance or its root $data at runtime - declar(图1)

[Vue warn]: Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option.

大概意思就是说 避免在运行时向Vue实例或其根$data添加反应性属性-在数据选项中预先声明它。

他让我们在$data添加属性,我们就进行添加

可以先在按钮里面定义一个属性,名字随意,如图

[Vue warn]: Avoid adding reactive properties to a Vue instance or its root $data at runtime - declar(图2)

 然后在data里面将他return回去就行

[Vue warn]: Avoid adding reactive properties to a Vue instance or its root $data at runtime - declar(图3)

 报错消失,问题解决

希望能有所帮助

本站所有文章、数据、图片均来自互联网,一切版权均归源网站或源作者所有。

如果侵犯了你的权益请来信告知我们删除。邮箱:licqi@yunshuaiweb.com

加载中~
如果您对我们的成果表示认同并且觉得对你有所帮助可以给我们捐赠。您的帮助是对我们最大的支持和动力!
捐赠我们
扫码支持 扫码支持
扫码捐赠,你说多少就多少
2
5
10
20
50
自定义
您当前余额:元
支付宝
微信
余额

打开支付宝扫一扫,即可进行扫码捐赠哦

打开微信扫一扫,即可进行扫码捐赠哦

打开QQ钱包扫一扫,即可进行扫码捐赠哦