test: 无界降级测试加载渲染器

This commit is contained in:
wangxuefeng
2025-03-17 20:25:45 +08:00
parent 8e208e7468
commit 3861919c4f
13 changed files with 54 additions and 67 deletions

View File

@@ -4,11 +4,14 @@ import { onBeforeUnmount, onMounted } from 'vue';
import WujieVue from 'wujie-vue3';
const props = defineProps<{
[key: string]: any;
accessToken?: string;
applicationId: number | string;
degrade?: boolean;
fileId: number | string;
name: string;
projectId: number | string;
sync: boolean;
url: string;
}>();
@@ -16,14 +19,6 @@ console.log('props', props);
const { bus } = WujieVue;
// 传递给子应用的属性
const subAppProps = {
accessToken: props.accessToken,
applicationId: props.applicationId,
fileId: props.fileId,
projectId: props.projectId,
};
// 生命周期钩子
const beforeLoad = (appWindow: Window) => {
console.log(`${props.name} 开始加载`, appWindow);
@@ -46,24 +41,17 @@ onBeforeUnmount(() => {
bus.$off('message', handleMessage);
});
</script>
<template>
<div class="low-code-adapter" style="width: 100%; height: 100%">
{{ url }}
{{ name }}
<WujieVue
:name="name"
:url="url"
width="100%"
height="100%"
:props="subAppProps"
/>
</div>
{{ props }}
<WujieVue
:name="name"
:url="url"
:sync="sync"
:degrade="degrade"
width="100%"
height="100%"
:props="props"
:before-load="beforeLoad"
:after-mount="afterMount"
/>
</template>
<style scoped>
.low-code-adapter {
width: 100%;
height: 100%;
}
</style>