[Vuejs]-I created a button component with a loader integrated in VueJs. I passed my loader as props but I can't get it to work with a method in a vueJs page,

0👍

Try this:

test () {
  setTimeout(() => {
    alert('test btn');
  }, 2000);
  this.loader = !this.loader;
},

Make sure to remove the v-bind on loader, so just loader="false" instead of :loader="false". Vue will treat true as primitives without v-bind, otherwise as variables or methods

Leave a comment