1.0.22 • Published 5 years ago

vuelidate-errors-catch v1.0.22

Weekly downloads
13
License
MIT
Repository
github
Last release
5 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

5 years ago

1.0.21

5 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago