vue3 computed

const supercomputed = computed({get (){console.log(get属性+states.value)return get属性+states.value},set(){console.log(set属性+states.value)}})// supercomputed.value = 2 //一般不再computed中写...

const supercomputed = computed({
  get (){
    console.log('get属性'+states.value)
    return 'get属性'+states.value
  },
  set(){
    console.log('set属性'+states.value)
  }
})
// supercomputed.value = 2 //一般不再computed中写set
// console.log(supercomputed.value)

本文标题为:vue3 computed

基础教程推荐