1.0.22 • Published 4 years ago

vuelidate-errors-catch v1.0.22

Weekly downloads
13
License
MIT
Repository
github
Last release
4 years ago

Vuelidate Errors Catch

Simple error message extrator for Vuelidate.

Features & characteristics

  • Ready to use
  • Support custom messages
  • Support other languages
  • Support custom attribute names
  • No vue component for message bag, it's an array of messages

Prerequisites

Works with Vuelidate.

Installing and usage

Install the package:

yarn add vuelidate-errors-catch or npm install vuelidate-errors-catch

Import into your main.js application file:

import VuelidateErrorsCatch from 'vuelidate-errors-catch'

Binds to the Vue app instance:

Vue.use(VuelidateErrorsCatch, {
  language: 'ptBR',
  messages: {
    // custom messages [key: value]
  },
  fields: {
    // custom fields [key: value]
  }
})

API Referencce

language: The default message language. This version has only english (en-US) and portuguese (pt-BR) language files. Want to see your language here, please, send a PR.

messages: You can add your own custom messages, can be a String or a Function.

messages: {
    document: 'Invalid document.',
    maxMoney: field => `Maximum value of ${field.toLocaleString('en-US', { style: 'currency', currency: 'USD', currencyDisplay: 'symbol', minimumFractionDigits: 2 })} reached.`
}

fields: The form attribute name, or form fields. The package will use for change a raw name for a user-friendly name.

fields: {
    ssn: 'social security number',
    user_email: 'email'
}

Contributing

You found a bug? Wish to contribute with the project? Send a PR.

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago