[Vuejs]-How to use getElementById and addEventListener when not in the DOM?

1👍

According to the Vue documentation, you may get it work if calling getElementById like this:

mounted: function () {
  this.$nextTick(function () {

    const el = document.getElementById("openKeyboard");
    el.addEventListener("click", this.modifyText, false);

  })
}

Leave a comment