[Vue warn]: data functions should return an object:

博客讨论了在使用Vue.js和ElementUI时遇到的一个常见错误,即通过`this.$message.error(res)`传递错误信息时传入了不正确的类型。问题源于将数组而非对象传递给了`message.error()`方法,导致Vue警告关于$data属性访问和数据类型匹配的问题。解决方案是确保传入正确类型的参数,通常是一个包含自定义类名或其他属性的对象。

vue报错

[Vue warn]: data functions should return an object:

[Vue warn]Property "customClass" must be accessed with "$data.customClass" because properties starting with "$" or "_" are not proxied in the Vue instance to prevent conflicts with Vue internals

 原因使用 ElementUI 的   this.$message.error(res); 导致。message.error()传入的类型错误,

应该为obj、string传入了array

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值