vee-validate
vee-validate copied to clipboard
[v4] Question: How to get target cross field name ?
Hello @logaretm I am upgraded to v4 and I have this use case
import { defineRule } from 'vee-validate'
import { isEqual } from 'lodash'
defineRule('isDifferent', (value, { target }, ctx) => {
if (isEqual(target, value)) {
return `The ${ctx.field} must be different from ?`
}
return true
})
How I can get access of target field name without defining it manually ? In v3 I am able to get access by message function like below code
message(field, values) {
return i18n.t('error.notSame', values)
},
And i18n message was The {_field_} must be different from {target}
Thanks
I would like to know this as well!
It seems that this feature has disappeared after Vue 3 :(
Hello, any news ? Did you find a solution ?
@logaretm