0👍
You can’t. disable
property is used only in form elements. What you’re looking for here is to use v-if
:
<a id="closeButton" title="Close" class="c-btn" @click="close" v-if="isConditionMatched">
Only show if isConditionMatched returns true
</a>
Or, conditionally you can use return false
statement inside your method:
close() {
if(!isConditionMatched) return false;
// continue your close function
}
- [Vuejs]-Accessing data from method after it was initialized- vuejs
- [Vuejs]-Laravel VueJS axios interceptor accessing the vue application
Source:stackexchange.com