I am looking to execute a function in my methods
section only when all three variables, test1
, test2
, and test3
, are populated. If any of them are empty, I want nothing to happen.
I have attempted to achieve this using computed
properties and then with a watcher
, but unfortunately, it has not been successful for me.
I would appreciate any guidance or assistance on this matter.
computed: {
test1() {
return this.$store.state.test1;
},
test2() {
return this.$store.state.test2;
},
test3() {
return this.$store.state.test3;
},
check_data() {
return this.test1 && this.test2 && this.test3;
},
},
watch: {
check_data() {
this.trigger_method()
},
},