I want to make it so that a user can only trigger an on click event and then execute a function only if a certain variable is true. For example:
<button @click='hello'>Trigger</button>
data: function() {
return {
isAuth: true
}
},
methods: {
hello(){
console.log('hello')
}
}
I just want to point out that I don't want to only hide the button. I want to make clicks on the button element not trigger unless isAuth: true.