How can I add items to the hasErrors array if the input username or password are empty and remove them if the input are not empty so that the disabled class on the submit button is dynamically enabled/disabled?
<form>
<input type="username" v-model="form.username">
<input type="password" v-model="form.password">
<input type="submit" :disabled="hasErrors.length > 0">
</form>
<script>
var app = new Vue({
el: '#app',
data: {
form: {
username = '',
password = '',
hasErrors: []
}
}
});
</script>