1
0
mirror of synced 2025-12-26 17:08:00 +08:00

fix: 迭代器内的组件配置了声明周期代码块无效

This commit is contained in:
roymondchen
2024-08-13 20:24:24 +08:00
committed by roymondchen
parent 9e4da0a5c2
commit 60d2b64aa5
22 changed files with 163 additions and 133 deletions

View File

@@ -19,7 +19,6 @@
"peerDependencies": {
"@tmagic/utils": "workspace:*",
"@tmagic/schema": "workspace:*",
"@tmagic/vue-container": "workspace:*",
"@tmagic/vue-runtime-help": "workspace:*",
"typescript": "*"
},

View File

@@ -1,19 +1,14 @@
<template>
<TMagicContainer class="magic-ui-page" :config="config"></TMagicContainer>
<magic-ui-container class="magic-ui-page" :data-tmagic-id="config.id" :config="config"></magic-ui-container>
</template>
<script lang="ts">
import { defineComponent, type PropType } from 'vue-demi';
import type { MPage } from '@tmagic/schema';
import TMagicContainer from '@tmagic/vue-container';
import { useApp } from '@tmagic/vue-runtime-help';
export default defineComponent({
components: {
TMagicContainer,
},
props: {
config: {
type: Object as PropType<MPage>,
@@ -30,10 +25,14 @@ export default defineComponent({
window.location.reload();
};
useApp({
const { app } = useApp({
config: props.config,
methods: { refresh },
});
return {
app,
};
},
});
</script>