[Vuejs]-Local dependency not loaded with Vue/Vue Router, only after hard refresh

0👍

Looking at the source code for jscolor, it appears that it registers itself onto elements with the jscolor class when the page has loaded. Any new elements inserted into the DOM at a later time will be unaffected.

Your choices are:

  • Use a different library that supports dynamic elements.
  • You must manually attach jscolor to new elements after they have been added to the DOM (you could use a custom directive to do this).

It’s interesting that jscolor doesn’t use event delegation for click events to cover this scenario.

Leave a comment