I have several differents files for a lot of modules. Some of the share the same action name
There is some page that use 2 or more mapActions for different modules On my page is something like this:
methods: {
...mapActions({
documents: ['setDocumentImage'],
documentAddress: ['setDocumentImage'],
selfie: ['setDocumentImage']
}),
}
All my modules have a action setDocumentImage
But the problem is that i have to invoke them like: this.setDocumentImage(file)
Is there a way to create an alias for each one of these mapAction that my page can differentiate? Or how can I fix it?
Yes there is a way ! Here you are :
methods: {
...mapActions('documents', { setDocumentImage: 'setDocumentImage' }),
...mapActions('documentAddress', { setDocumentAddressImage: 'setDocumentImage' }),
...mapActions('selfie', { setSelfieDocumentImage: 'setDocumentImage' }),
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With