MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / onResize

Function onResize

public/iframe/lib/js/mixinsComponents.js:2542–2563  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2540 },
2541 methods: {
2542 async onResize() {
2543 // 根据当前屏幕尺寸进行缩放达到和编辑器显示的效果一致
2544 for (const item of this.templateList) {
2545 if (this.basicConfig.zoomMode.default === 'YOY') {
2546 this.initElementZoom(item.property)
2547 }
2548 this.initSize(item.property)
2549 item.isLoading = this.guid()
2550 this.$forceUpdate()
2551 // await this.initData(item)
2552 }
2553 this.loading = false
2554 let zoomHeight = 1
2555 if (this.basicConfig.zoomMode.default === 'YOY') {
2556 // if (document.documentElement.clientWidth > this.basicConfig.width) {
2557 // 实际宽比预设宽大 则按照页面实际高除去 预设放大的高 进行缩放
2558 zoomHeight = document.documentElement.clientHeight / (this.innerZoom * this.basicConfig.height)
2559 if (zoomHeight > 1) { zoomHeight = 1 }
2560 // }
2561 this.$refs.body.style.zoom = zoomHeight
2562 }
2563 },
2564 initElementZoom(item) {
2565 // 刷新组件的缩放
2566 const nowWidth = this.$refs.body && this.$refs.body.offsetWidth

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected