Browse Source

docs: fix vue dom work

DIYgod 2 years ago
parent
commit
a0424ca303
1 changed files with 6 additions and 2 deletions
  1. 6 2
      docs/.vuepress/components/DPlayer.vue

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

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