1
0
mirror of synced 2025-12-14 06:47:56 +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,17 +1,18 @@
<template>
<magic-ui-container
<component
:is="containerComponent"
class="magic-ui-page-fragment"
:data-tmagic-id="config.id"
:config="config"
:style="app?.transformStyle(config.style || {})"
></magic-ui-container>
></component>
</template>
<script lang="ts">
import { defineComponent, type PropType } from 'vue-demi';
import type { MPageFragment } from '@tmagic/schema';
import { useApp } from '@tmagic/vue-runtime-help';
import { useApp, useComponent } from '@tmagic/vue-runtime-help';
export default defineComponent({
props: {
@@ -31,8 +32,11 @@ export default defineComponent({
methods: {},
});
const containerComponent = useComponent({ componentType: 'container', app });
return {
app,
containerComponent,
};
},
});