let person = shallowReactive({
name: 'tm', // name只能读,不能修改
age: 18, // age只能读,不能修改
job: { // job只能读,不能修改
job1: { // job1只能读,不能修改
salary: 20 // salary只能读,不能修改
}
}
})
person = readonly(person)
let person = shallowReactive({
name: 'tm', // name只能读,不能修改
age: 18, // age只能读,不能修改
job: { // job只能读,不能修改
job1: { // job1既能读,也能改
salary: 20 // salary既能读,也能改
}
}
})
person = shallowReadonly(person)
letnum = ref(18)
num = readonly(num) // num 只能读,不能修改