@slikmen/vue-validation

Removes all spaces from a string

Usage no npm install needed!

<script type="module">
  import slikmenVueValidation from 'https://cdn.skypack.dev/@slikmen/vue-validation';
</script>

README

validation

Version License Size

What purpose is this npm package

When I was developing, I found a feature that was not implemented yet. The issue lies in Vee-validate Version 2.*.

I found that when I wanted to remove the error message on focus and revalidate field on blur this was not possible.

To make it possible I used the Vee-validation API to remove and validate. This is just an extension on Vee-validate and works with every rule.

How to use

For non-global you need to add a directive 'v-validate-custom'

// import Script
import vueValidation from '@slikmen/vue-validation'
Vue.use(vueValidation)
<template>
    <div>
        <input name="field" v-validate="'required'" v-validate-custom>
        <p v-if="errors.has('field')">{{ errors.first('field') }}</p>
    </div>
</template>

Global option

For global use you just need to add true in the Vue.use()

// import Script
import vueValidation from '@slikmen/vue-validation'
Vue.use(vueValidation, true)

<template>
    <div>
        <input name="field" v-validate="'required'">
        <p v-if="errors.has('field')">{{ errors.first('field') }}</p>
    </div>
</template>