0
You need to provide an object to the :class
, see here:
https://v3.vuejs.org/guide/class-and-style.html#binding-html-classes
I suggest you create a variable in the script containing the boolean e.g. isValid
and then apply it like this:
:class="{invalidInput : !isValid, validInput: isValid }"
Source:stackexchange.com