export default { data() { return { firstName: "", lastName: "", nikeName: "", } }, computed:{ name(){ if(this.nikeName){ // 这里有个耗时任务,如何从框架角度在更新 firstName和lastName时候不执行这里 return this.nikeName } else return this.firstNmae+this.lastName } } } </script> <template> <button>{{ name }}</button> </template>