VUE2
computed: {
// 不传参
getPrice() {
return this.list.length
},
// 传参
getNum() {
return function(ticketId) {
return ticketId
}
}
}
VUE3
// 带参
const hasParams = computed(() => {
return (value: string) => {
return value;
};
});
// 不带参
const noParams = computed(() => {
return 1 > 0 ? 'Yes' : 'No'
})