1
0
mirror of synced 2026-03-23 02:58:34 +08:00

feat(vue-component, runtime): 使用 app.resolveComponent 获取组件 (#631)

This commit is contained in:
洩氏诹诹子
2024-09-03 21:07:55 +08:00
committed by roymondchen
parent 6e71448158
commit c3bc1035ad
21 changed files with 184 additions and 31 deletions

View File

@@ -1,11 +1,12 @@
<template>
<div>
<magic-ui-container
<component
:is="containerComponent"
:iterator-index="iteratorIndex"
:iterator-container-id="iteratorContainerId"
:config="containerConfig"
:model="model"
></magic-ui-container>
></component>
</div>
</template>
@@ -13,7 +14,7 @@
import { computed, defineComponent, type PropType } from 'vue-demi';
import { type Id, type MComponent, type MNode, NodeType } from '@tmagic/schema';
import { useApp } from '@tmagic/vue-runtime-help';
import { useApp, useComponent } from '@tmagic/vue-runtime-help';
export default defineComponent({
props: {
@@ -37,6 +38,8 @@ export default defineComponent({
iteratorIndex: props.iteratorIndex,
});
const containerComponent = useComponent({ componentType: 'container', app });
const fragment = computed(() => app?.dsl?.items?.find((page) => page.id === props.config.pageFragmentId));
const containerConfig = computed(() => {
@@ -64,6 +67,7 @@ export default defineComponent({
});
return {
containerComponent,
containerConfig,
};
},