2024-09-14 11:15:07 +08:00

41 lines
856 B
Vue

<template>
<component :is="containerComponent" class="magic-ui-page" :data-tmagic-id="config.id" :config="config"></component>
</template>
<script lang="ts">
import { defineComponent, type PropType } from 'vue-demi';
import type { MPage } from '@tmagic/core';
import { useApp, useComponent } from '@tmagic/vue-runtime-help';
export default defineComponent({
props: {
config: {
type: Object as PropType<MPage>,
required: true,
},
model: {
type: Object,
default: () => ({}),
},
},
setup(props) {
const refresh = () => {
window.location.reload();
};
const { app } = useApp({
config: props.config,
methods: { refresh },
});
const containerComponent = useComponent({ componentType: 'container', app });
return {
containerComponent,
};
},
});
</script>