I am using vuelidate library to validate the URL. I wanted input only to accept specific URL types. They are "http://www.example.com", "https://www.example.com", "www.example.com" . If entered URL not matched with the above-mentioned patterns, then I need an error. Below is my code
import { maxLength, url } from "vuelidate/lib/validators";
export default {
data() {
return {
form: {
homepageUrl: null,
},
};
},
validations: {
form: {
homepageUrl: { url, maxLength: maxLength(150) },
},
},
}
Note: It could be any domain like .net .co.in .com .it .av .let