B
B
BonBon Slick2019-08-15 10:17:26
Vue.js
BonBon Slick, 2019-08-15 10:17:26

How to catch the DOM change event of an element by an external library?

https://vuejs.org/v2/guide/computed.html

<video ref="videoPlayer"
                       class='video-js vjs-big-play-centered'
                       :key="getCurrentPlayVideoUrl"
                >
   
                    <source :src="getCurrentPlayVideoUrl"
                            type="video/mp4"
                            v-model="this.currentVideoSource"
                    >
                </video>

export default {

        data() {
            return {
                currentVideoSource: '', // @todo - it is by default differs from  getCurrentPlayVideoUrl
                player: null,
            }
        },
 watch: {
            currentVideoSource: function (newQuestion, oldQuestion) {
                console.log(newQuestion);
                console.log(oldQuestion);
            }
        },

But when the link is changed by the player, watch is never called and currentVideoSource remains the same.
Is there any way to make it vue style without native ES listeners?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question