Vue3 其它API readonly和shallowreadonly
- readonly,只读,a是可以修改值的,a1不能
- shallowreadonly,浅层次只读,b中所有属性的值是可以修改,b1中name不能修改,其它可以修改
let a = ref('123');
let a1 = readonly(a);
let b = ref({
'name':'abc'
'hobby':{
'game':'game',
'foot':'foot'
}
})
let b1 = shallowreadonly(b);