Skip to content

Commit

Permalink
Merge pull request #9533 from dataease/pr@dev-v2_st
Browse files Browse the repository at this point in the history
fix(嵌入式): 嵌入式场景下仪表板切换到移动端无法正常显示
  • Loading branch information
dataeaseShu committed May 8, 2024
2 parents 242c691 + 8d2fe2c commit 8142d3a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/core-frontend/src/views/mobile/panel/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ const hanedleMessage = event => {
}
}
onBeforeMount(() => {
let p = null
const XpackLoaded = () => p(true)
onBeforeMount(async () => {
await new Promise(r => (p = r))
window.top.postMessage({ type: 'panelInit', value: true }, '*')
window.addEventListener('message', hanedleMessage)
useEmitt({
Expand All @@ -106,6 +109,7 @@ const mobileStatusChange = (type, value) => {
eventBus.emit('removeMatrixItemById-canvas-main', value)
}
}
onBeforeUnmount(() => {
window.removeEventListener('message', hanedleMessage)
})
Expand All @@ -115,6 +119,11 @@ onBeforeUnmount(() => {
<div class="panel-mobile">
<de-preview-mobile v-if="panelInit"></de-preview-mobile>
</div>
<XpackComponent
jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvTmV3V2luZG93SGFuZGxlcg=="
@loaded="XpackLoaded"
@load-fail="XpackLoaded"
/>
</template>

<style lang="less" scoped>
Expand Down

0 comments on commit 8142d3a

Please sign in to comment.