Set operation on key “visible“ failed: target is readonly.
vue3 报错 Set operation on key "visible" failed: target is readonly.变量visible只读属性,无法修改。解决:visible 改成响应式// 原先visible 从props.modal获取,const { modalData: { visible }} = props//修改const { modalData: { visible
·
vue3 报错 Set operation on key "visible" failed: target is readonly.
变量visible只读属性,无法修改。
解决:visible 改成响应式
// 原先visible 从props.modal获取,
const { modalData: { visible }} = props
//修改
const { modalData: { visible }} = props
const visibleNew = ref(visible)
或
const { modalData: { visible }} = toRefs(props)
其他场景:
1.antd版本问题
解决控制台警告 Set operation on key "xxx" failed: target is readonly - 简书
2.修改启动模式
https://www.136.la/nginx/show-123998.html
VUE3出现Set operation on key "default" failed: target is readonly. 控制台报该警告的解决方案 - ShuZhaoCL - 博客园
更多推荐
已为社区贡献4条内容
所有评论(0)