Răsfoiți Sursa

docs: fix vue dom work

DIYgod 3 ani în urmă
părinte
comite
a0424ca303
1 a modificat fișierele cu 6 adăugiri și 2 ștergeri
  1. 6 2
      docs/.vuepress/components/DPlayer.vue

+ 6 - 2
docs/.vuepress/components/DPlayer.vue

@@ -71,12 +71,16 @@ export default {
     methods: {
     methods: {
         load: function () {
         load: function () {
             this.options.container = this.$refs.dplayer;
             this.options.container = this.$refs.dplayer;
-            this.dplayer = new window.DPlayer(this.options);
+            setTimeout(() => {
+                this.dplayer = new window.DPlayer(this.options);
+            }, 0);
         }
         }
     },
     },
     mounted: function () {
     mounted: function () {
         if (this.immediate) {
         if (this.immediate) {
-            this.dplayer = new window.DPlayer(this.options);
+            setTimeout(() => {
+                this.dplayer = new window.DPlayer(this.options);
+            }, 0);
         }
         }
     },
     },
     beforeDestroy: function () {
     beforeDestroy: function () {