chore: 排查无界加载异常的问题
This commit is contained in:
@@ -43,7 +43,8 @@ const initPostmate = async () => {
|
||||
console.log('finalUrl', finalUrl);
|
||||
|
||||
const connection = new Postmate({
|
||||
container,
|
||||
classListArray: ['low-code-adapter-iframe'],
|
||||
container: document.querySelector('#low-code-adapter'),
|
||||
model: {
|
||||
accessToken: props.accessToken,
|
||||
// 其他参数仍然保留在 model 中,以保持兼容性
|
||||
@@ -57,12 +58,16 @@ const initPostmate = async () => {
|
||||
url: finalUrl,
|
||||
});
|
||||
|
||||
connection.then((child) => {
|
||||
child.frame.style.height = '100%';
|
||||
child.frame.style.width = '100%';
|
||||
connection.then((ctx) => {
|
||||
console.log('ctx', ctx);
|
||||
console.log('ctx.parent', ctx.parent);
|
||||
console.log('ctx.parent.innerHeight', ctx.parent.innerHeight);
|
||||
ctx.frame.style.height = `${ctx.parent.innerHeight - 38 - 88}px`;
|
||||
ctx.frame.style.minHeight = `800px`;
|
||||
ctx.frame.style.width = '100%';
|
||||
// @ts-ignore 忽略 console
|
||||
console.log(`${props.name} 连接成功`, child);
|
||||
child.call('child-connected', {
|
||||
console.log(`${props.name} 连接成功`, ctx);
|
||||
ctx.call('child-connected', {
|
||||
name: props.name,
|
||||
});
|
||||
});
|
||||
@@ -74,19 +79,11 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
id="low-code-adapter"
|
||||
class="low-code-adapter"
|
||||
style="width: 100%; height: 100%"
|
||||
></div>
|
||||
<div id="low-code-adapter"></div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.low-code-adapter {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.low-code-adapter iframe {
|
||||
<style>
|
||||
.low-code-adapter-iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
|
||||
Reference in New Issue
Block a user