I have a form that is subject to different validations depending on the parameter called action
stored in VUEX store. I am attempting the following:
data: function() {
const validations = {
sendToProject: {
cardProject: {
required,
},
},
recallToBranch: {
fioReceiver: {
required,
}
}
}
return {
validations,
}
},
validations() {
return {
q: this.validations[this.action] // supposed to be this.validations['sendToProject']
}
},
computed: {
...mapGetters({
action: 'action',
}),
},
Although it functions correctly, it throws an error during bootstrapping:
[Vue warn]: Error in render function: "TypeError: can't convert undefined to object"
This error prevents non-Vue code (such as Bootstrap jQuery plugins initializations) from running.
What's the solution?