Hi,
Just a tip if you want to post code put your code inside ```
so your code will be
methods: {
alert: function () { this.$emit('onoff') }
},
created () {
this.$on('onoff', function ()
{ if ('gender' === ' ' || 'age' === ' ' || 'activity' === '' || 'weight' === ' ')
{ return 'true' } else { return 'false' } } ) }
revised
export default {
data() {
return {
gender: ' ',
age: ' ',
activity: ' ',
weight: ' '
}
},
methods: {
alert() {
this.$emit('onoff')
}
},
created() {
//WHAT DO YOU WANT TO DO WITH THE CODE?
}
}
post your code!