vue-validation-message
v0.2.1
Published
## Como usar 1) No componente desejado, importar a lib ```js import validation from 'vue-validation-message' ```
Downloads
4
Readme
vue-validation-message
How to use
- In the desired component, import the lib
import validation from 'vue-validation-message'
- Add to the component's list
components: {
validation
}
- Show the validation message
<validation :property="$v.model.name" message="Must be filled in the correct format" v-multi-ref:validation />
Being:property
the vuelidate propertymessage
the validation messagev-multi-ref:validation
the reference (v-multi-ref), a trigger to activate de message
Advanced usage
If you have multiple validations to a single property, e.g:
validations: {
model: {
name: {
required,
validFormat: function() {
return x === y
}
}
}
}
You can pass the message parameter as an object with the properties and messages:
<validation :property="$v.model.name" :message="{required: 'Please fill out this field', validFormat: 'Must be filled in the correct format'}" v-multi-ref:validation />
Project setup
yarn install
Compiles and hot-reloads for development
yarn run serve
Compiles and minifies for production
yarn run build
Run your tests
yarn run test
Lints and fixes files
yarn run lint