| | |
| | | <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> |
| | |
| | | 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: { |
| | |
| | | loadPageList: { |
| | | handler(newVal, oldVal) { |
| | | setTimeout(() => { |
| | | this.transformDom(this.$store.state.qiankun.fontSize) |
| | | this.initSwiper(); |
| | | this.initViewer(); |
| | | this.closeAudio(); |
| | |
| | | }, |
| | | //其他类名下字体大小变化 |
| | | 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' |
| | | } |
| | | } |
| | | }, |