From ef510e10314f6d562c89b60a75c0862de4cf2d58 Mon Sep 17 00:00:00 2001 From: zhongshujie <2862698242@qq.com> Date: 星期五, 25 十月 2024 15:53:46 +0800 Subject: [PATCH] bug修改 --- src/books/civilAviation/view/components/index.vue | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/books/civilAviation/view/components/index.vue b/src/books/civilAviation/view/components/index.vue index c140f6c..2cee5ad 100644 --- a/src/books/civilAviation/view/components/index.vue +++ b/src/books/civilAviation/view/components/index.vue @@ -4,8 +4,8 @@ <div id="searchContent"></div> </div> <div class="page-content" :style="{ - fontSize: fontSize ? fontSize + 'px' : '18px', - transform: `scale(${pageZoom ? pageZoom : 1})`, + fontSize: fontSize + 'px', + transform: `scale(${pageZoom})`, transformOrigin: 'center top', }"> <pageHeader v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList"></pageHeader> @@ -47,10 +47,10 @@ computed: { fontSize() { this.transformDom(this.$store.state.qiankun.fontSize) - return this.$store.state.qiankun.fontSize; + return this.$store.state.qiankun.fontSize ? this.$store.state.qiankun.fontSize : 18; }, pageZoom() { - return this.$store.state.qiankun.scale / 100; + return this.$store.state.qiankun.scale ? this.$store.state.qiankun.scale / 100 : 1; }, }, watch: { @@ -75,6 +75,7 @@ loadPageList: { handler(newVal, oldVal) { setTimeout(() => { + this.transformDom(this.$store.state.qiankun.fontSize) this.initSwiper(); this.initViewer(); this.closeAudio(); @@ -913,9 +914,14 @@ }, //鍏朵粬绫诲悕涓嬪瓧浣撳ぇ灏忓彉鍖� transformDom(fs) { - const blockElement = this.$refs.blockElement; - if (blockElement) { - blockElement.style.fontSize = fs; // 鎴栬�呬綘鎯宠鐨勪换浣曞ぇ灏� + if(!fs) return + let doms = ( + this.container ? this.container : document + ).querySelectorAll('.block') + if(!doms.length) return + for (let index = 0; index < doms.length; index++) { + const dom = doms[index]; + dom.style.fontSize = fs + 'px' } } }, -- Gitblit v1.9.1