Browse Source

Merge branch 'lhd'

natasha 1 tháng trước cách đây
mục cha
commit
b6df00f58e

+ 4 - 2
src/views/book/courseware/preview/components/new_word/NewWordPreview.vue

@@ -1690,8 +1690,10 @@ export default {
   },
   mounted() {
     this.$nextTick(() => {
-      let totalWidth = document.querySelector('.newWord-preview').offsetWidth;
-      this.width = `${totalWidth - (this.data.property.sn_display_mode === 'true' ? 15 : 0)}`;
+      setTimeout(() => {
+        let totalWidth = document.querySelector('.newWord-preview').offsetWidth;
+        this.width = `${totalWidth - (this.data.property.sn_display_mode === 'true' ? 15 : 0)}`;
+      }, 200);
     });
 
     this.dataHeight = this.$refs.previewContainer ? this.$refs.previewContainer.style.height : 0;