chore: 无界测试

This commit is contained in:
wangxuefeng
2025-03-17 17:38:03 +08:00
parent d55ae2e97d
commit 32db9d8175
10 changed files with 485 additions and 93 deletions

View File

@@ -0,0 +1,62 @@
<script setup lang="ts">
import { onBeforeUnmount, onMounted } from 'vue';
import WujieVue from 'wujie-vue3';
const props = defineProps<{
accessToken?: string;
applicationId: number | string;
fileId: number | string;
name: string;
projectId: number | string;
url: string;
}>();
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);
};
const afterMount = (appWindow: Window) => {
console.log(`${props.name} 加载完成`, appWindow);
};
// 事件处理
const handleMessage = (data: any) => {
console.log('收到子应用消息:', data);
};
onMounted(() => {
bus.$on('message', handleMessage);
});
onBeforeUnmount(() => {
bus.$off('message', handleMessage);
});
</script>
<template>
<div class="low-code-adapter" style="width: 100%; height: 100%">
{{ url }}
<WujieVue width="100%" height="100%" :props="subAppProps" />
</div>
</template>
<style scoped>
.low-code-adapter {
width: 100%;
height: 100%;
}
</style>

View File

@@ -0,0 +1 @@
export { default } from './adapter.vue';