I am currently attempting to implement phone field validation in vue.js, where I need to verify the user's phone number using a regex expression and ensure that the field is not left empty.
<div v-if="shouldPhoneFieldDisplay" class="flex xs12 sm5">
<validation-provider v-slot="{ errors }" rules="{ required:true, regex: /^\(?\d{3}\)?[-\s]?\d{3}[-\s]?\d{4}$/ }">
<label for="bill-to-phone">Phone Number</label>
<input name="Phone Number" v-model="data.bill.billphone" class="form-control" id="billphone" type="tel" maxlength = "255">
<span class="error--text">{{ errors[0] }}</span>
</validation-provider>
</div>
Unfortunately, this implementation is encountering issues as it displays an error on the browser.
Uncaught (in promise) Error: No such validator '{ required, helpers.regex( /^(?d{3})?[-s]?d{3}[-s]?d{4}$/ ) }' exists.