I have the following element in my list.vue file:
<a id="anchorLink"
class="button is-primary is-fullwidth-mobile mb-sm"
@click="functionA()">
<span>Call Function A</span>
</a>
And this is the function functionA
async functionA() {
// do something
},
All I want to do is disable the anchor link until functionA processing is done, then only enable back the link.
So i tried all these options to disable it but no luck so far:
OPTION01:
async functionA() {
document.getElementById('anchorLink').disabled = true;
// do something
}
OPTION02: using .prevent
<a id="anchorLink"
class="button is-primary is-fullwidth-mobile mb-sm"
@click.prevent="functionA()">
<span>Call Function A</span>
</a>
OPTION03: using v-on:click.prevent
<a id="anchorLink"
class="button is-primary is-fullwidth-mobile mb-sm"
v-on:click.prevent="functionA()">
<span>Call Function A</span>
</a>
I don't get any console error when I tried all the options, but it still doesn't do the job.
Can someone please help me out here.