<button @click.prevent="getVerifyCode">获取验证码</button>
For example, a line of code like this, assuming I have a variable like isRightPhoneNumber
, I hope that the above button will be enabled only when my isRightPhoneNumber
is true
What should I do if the event takes effect? One way I thought of is to add judgment in the getVerifyCode
function, like this
if(!this.isRightPhoneNumber) return;
But I don’t really want to use this method, so I would like to ask if there is any other method, is there any method similar to v-if
{{messageLogin?'登录':'密码登录'}}
<form class='message-form' v-if='messageLogin'></form>