I am creating a simple application in which there will be few listeners. I can’t understand what logic should look like.
HTML:
<div id="playerProgressBar">
<div id="playerHead"></div>
</div>
In the Vue object, I defined a variable:
music: document.getElementById('playerHead');
My listener should look like this:
music.addEventListener("timeupdate", timeUpdate, false);
music.addEventListener("canplaythrough", function () {
}, false);
function timeUpdate() {
}
So what would be the right way to use listeners in vuejs? Should I use custom directives here? Since I have no event, I cannot use methods. Putting all the logic in a function readyseems wrong. Thanks in advance!
source
share