0π
β
The $v.user.password.maxLength
value is false
when the validation fails (the character length exceeds the specified limit), but your <div>
is only shown when the validation passes. The fix is to invert the condition in v-else-if
:
<div v-else-if="$v.user.password.maxLength"> β
^
<div v-else-if="!$v.user.password.maxLength"> β
Also, your <input>.maxlength
is set to the maximum character length, which not only prevents the user from exceeding the character limit, but also prevents the validation from failing, so youβd never see the error message. The fix there is to remove the maxlength
binding:
<input :maxlength="maxpassword"> β
^^^^^^^^^^^^^^^^^^^^^^^^
<input> β
Source:stackexchange.com