vue2.0 练习中报错问题处理(数据绑定错误)

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-29 15:24   43   0

vue2.0 练习中报错问题处理

报错(数据是可以正确显示在页面中的):

[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "selectType"

报错说明

主要问题出在props的数据上,props绑定的数据是从父级传过来的,提示中 selectType 是自身组件中的数据,不需要从父级获取

解决方法

将 selectType 绑定到 data() 上就对了

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP