add field name in required validator

This commit is contained in:
les 2020-10-07 10:09:00 +02:00
parent a4fbcaa2ad
commit 0ab9475a10

View file

@ -4,7 +4,7 @@ export default ({ app }, inject) => {
const $t = app.i18n.t.bind(app.i18n)
const validators = {
required (fieldName) {
return value => !!value || $t('validators.required', { fieldName })
return value => !!value || $t('validators.required', { fieldName: $t(fieldName) })
},
email: [
v => !!v || $t('validators.required', { fieldName: $t('common.email') }),