How can I check file types (png,jpg,jpeg) with Vue.js Vuelidate library?
You can use helpers validator with regex check. More info here
import { helpers, required } from 'vuelidate/lib/validators'
const imageRule = helpers.regex('image', /\.(gif|jpe?g|tiff|png)$/)
export default {
data() {
return {
image: '',
}
},
validations: {
image: {
required,
imageRule
},
},
}