[Vuejs]-How do you wrap an achor tag in Vue2?

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
}

Leave a comment