0๐
โ
Use a computed property.
<button :disabled='shouldDisable'>Hello</button>
computed: {
shouldDisable() {
return !this.contactValid || !this.addressValid || !this.infoValid;
}
}
0๐
use vue computed property:
data: () => ({
infoValid: false,
contactValid: false,
addressValid: false
}),
computed: {
formsValid() {
if (this.infoValid && this.contactValid && this.addressValid){
return true;
}
return false;
},
}
Source:stackexchange.com