v-if 若只有两个选择,常用v-if和v-else <h1 v-if=" score >= 90"> v-if </h1> <h1 v-else> v-else </h1> 若需要多重判断,函数会更优 <h3>{{ifTest()}}</h3> methods : { ifTest(){ let result= " "; if (this.score > 90){ result = "gread"; }else if(this.score > 80){ result = "good"; }else { result = "not good"; } return result; } }