[Vuejs]-Vue2 & vee-validate – mapFields (nameFlags.valid property or method not found)

3👍

In your example you are not using mapFields helpers from vee-validate. You are creating mapFields property inside computed object which is also not valid as computed properties need to be methods same as formDirty() from your example not plain objects as mapFields.

You first need to import vee-validate helper in order to use it

import { mapFields } from ‘vee-validate’

then you should be able to use it as

    computed: {
      mapped: mapFields({
        nameFlags: 'name',
        emailFlags: 'email',
     }),
     formDirty() {
        // implementation
     }
    }

Leave a comment