Just started using Vue.js so lots to learn. I want to change the background color when an input is disabled because a computed function returns true. I can't seem to make it work.
This is in my export default
computed: {
disableField () {
if (condition) return true
}
}
This is in my template
<input
:class="{ disableInput: disableField }"
:disabled="disableField"
/>
This is in my CSS
.disable-input {
background-color: gray;
}
It disables the field when the computed function returns true but it doesn't change the background color.