// vue2
computed: {
fullName() {
return this.firstName + this.lastName;
}
}
// 传参
computed: {
fullName() {
return (params) => {
}
}
}
// vue3
const newName = computed(() => {
return name.value + 5 // 注意 ref 包装过的值在value中
})
const newName = computed(() => (item: any) => {
return item.id==='123'
})
标签:传参,vue,const,computed,newName,return,fullName
From: https://www.cnblogs.com/jia-zq/p/16807556.html