1
0
mirror of synced 2026-03-22 18:48:34 +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

@@ -5,15 +5,23 @@
<script lang="ts">
import { defineComponent, type PropType } from 'vue-demi';
import type { MComponent } from '@tmagic/schema';
import type { Id, MComponent } from '@tmagic/schema';
import { useApp } from '@tmagic/vue-runtime-help';
interface TextSchema extends Omit<MComponent, 'id'> {
id?: Id;
type?: 'text';
text: string;
}
export default defineComponent({
props: {
config: {
type: Object as PropType<MComponent & { type: 'text'; text: string }>,
type: Object as PropType<TextSchema>,
required: true,
},
iteratorIndex: Array as PropType<number[]>,
iteratorContainerId: Array as PropType<Id[]>,
model: {
type: Object,
default: () => ({}),
@@ -24,6 +32,8 @@ export default defineComponent({
useApp({
config: props.config,
methods: {},
iteratorContainerId: props.iteratorContainerId,
iteratorIndex: props.iteratorIndex,
});
},
});