Invalid watch source: A watch source can only be a getter/effect function, a ref, a reactive object
[Vue warn]: Invalid watch source: A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.
·
[Vue warn]: Invalid watch source:
A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.
vue3 中watch对象写法错误;应改为()=> 对象;
解决:
watch(() => _.cloneDeep(props.obj), (newValue, oldValue) => {
}, {deep: true})
// import _ from "lodash";
// _.cloneDeep 是解决多次watch 对象
更多推荐
已为社区贡献1条内容
所有评论(0)