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

302

被折叠的 条评论
为什么被折叠?



