forked from github/dataease
Merge pull request #8082 from dataease/pr@dev-v2_dzz_mobile
fix(嵌入式): iframe嵌入高度丢失
This commit is contained in:
commit
e16635f3b1
@ -49,7 +49,7 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
<!--前端组件有更新需要放开-->
|
<!--前端组件有更新需要放开-->
|
||||||
<execution>
|
<!-- <execution>
|
||||||
<id>npm install</id>
|
<id>npm install</id>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>npm</goal>
|
<goal>npm</goal>
|
||||||
@ -57,7 +57,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<arguments>install</arguments>
|
<arguments>install</arguments>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution> -->
|
||||||
|
|
||||||
<execution>
|
<execution>
|
||||||
<id>npm run build</id>
|
<id>npm run build</id>
|
||||||
|
@ -211,7 +211,6 @@ export function getCanvasStyle(canvasStyleData) {
|
|||||||
style['background'] = colorRGBA
|
style['background'] = colorRGBA
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('style', style)
|
|
||||||
return style
|
return style
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { shallowRef, defineAsyncComponent } from 'vue'
|
import { shallowRef, defineAsyncComponent, ref, onBeforeUnmount } from 'vue'
|
||||||
|
import { debounce } from 'lodash-es'
|
||||||
import { useEmbedded } from '@/store/modules/embedded'
|
import { useEmbedded } from '@/store/modules/embedded'
|
||||||
import { useAppStoreWithOut } from '@/store/modules/app'
|
import { useAppStoreWithOut } from '@/store/modules/app'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
@ -50,11 +51,27 @@ const init = () => {
|
|||||||
embeddedStore.setType(type)
|
embeddedStore.setType(type)
|
||||||
currentComponent.value = componentMap[type || 'ViewWrapper']
|
currentComponent.value = componentMap[type || 'ViewWrapper']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const iframeStyle = ref(null)
|
||||||
|
const setStyle = debounce(() => {
|
||||||
|
iframeStyle.value = {
|
||||||
|
height: window.innerHeight + 'px',
|
||||||
|
width: window.innerWidth + 'px'
|
||||||
|
}
|
||||||
|
}, 300)
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
|
window.addEventListener('resize', setStyle)
|
||||||
|
setStyle()
|
||||||
init()
|
init()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
window.removeEventListener('resize', setStyle)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<div :style="iframeStyle">
|
||||||
<component :is="currentComponent"></component>
|
<component :is="currentComponent"></component>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user