[Vuejs]-Return original input class when deleting content

0๐Ÿ‘

โœ…

i used keypress with a method to set hasError false

input(
    @keypress="checkInput"
    :class="hasError? 'border-red-600': 'border-green-700'"
    id="email"
    v-model="email"
    type="email"
    name="email"
    placeholder="type your email"
    required
    )

and method

methods: {
  checkInput: function() {
    this.hasError = false
  }
}

Leave a comment