Here is an example of my component:
<button
class="BtnLoader btn btn-primary-contained btn-iconed btn-mobile btn-important"
@click="onClick"
:aria-label="label"
:title="title">
<i v-if="loader" class="spinner icon-spinner3"></i>
<span v-if="loader" class="followingText">{{ textBtnLoader }}</span>
<span v-else class="followingText">{{ textBtn }}</span>
<i class="icon icon-arrow-right"></i>
The current behavior is not what I expected, as it only works with true or false values for the loader property. How can I pass this behavior to my method?
I want to be able to modify the loader status in my method like this:
<BtnLoader
label="test"
title="test BTN"
textBtn="TEST BTN"
textBtnLoader="Loading"
:onClick="test"
:loader="false"
/>
test() {
this.loader = !false;
setTimeout(() => {
alert('test btn');
}, 2000);
this.loader = !true;
},