From a0424ca303a6ad65da4e2585ad835a438002a650 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 16 Aug 2022 01:11:14 +0100 Subject: [PATCH] docs: fix vue dom work --- docs/.vuepress/components/DPlayer.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/.vuepress/components/DPlayer.vue b/docs/.vuepress/components/DPlayer.vue index 52b9729..73b09fd 100644 --- a/docs/.vuepress/components/DPlayer.vue +++ b/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 () {