computed: {
empty() {
return this.user.password === '' || this.user.confirmPassword === '';
},
equal() {
return !this.user.password && !this.$v.user.password.valid === !this.user.confirmPassword && !this.$v.user.confirmPassword.sameAsPassword
},
.no-empty {
opacity: 1.5;
background-color: #ee1d24;
}
.empty {
width: 160px;
height: 50px;
line-height: 50px;
text-align: center;
font-size: 16px;
font-weight: 600;
color: #fff;
background-color: #f68e91;
border-radius: 10px;
margin-top: 15px;
padding: 0 20px;
cursor: pointer;
opacity: 0.5;
display: flex;
justify-content: center;
align-items: center;
outline: none;
border: none;
}
<button
type="submit"
class="register-button-screen2"
value="Register"
:disabled="
(user.password && !$v.user.password.valid) ||
(user.confirmPassword &&
!$v.user.confirmPassword.sameAsPassword)
"
:class="[empty || !equal ? 'empty' : 'no-empty']"
@click="preset"
>
Clickme
</button>
In my equal method. Where it is comparing if password is equal or not.(that is working fine) But in my button under disabled with that condition i need to set in equal method.(So that it changes color if it is alphanumeric values only)