mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 15:36:49 +08:00
fix
This commit is contained in:
@@ -1,22 +1,24 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { type PropType, ref } from 'vue'
|
import { type PropType, ref } from 'vue'
|
||||||
|
|
||||||
|
// 组件配置
|
||||||
interface RenderProps {
|
interface RenderProps {
|
||||||
component: string
|
component: string
|
||||||
content: any
|
content: any
|
||||||
|
props: any
|
||||||
}
|
}
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const elementProps = defineProps({
|
||||||
config: Array as PropType<RenderProps[]>,
|
config: Array as PropType<RenderProps[]>,
|
||||||
})
|
})
|
||||||
|
|
||||||
// 配置表单
|
// 配置表单
|
||||||
const formItems = ref(props.config)
|
const formItems = ref(elementProps.config)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Component :is="item.component" v-for="(item, index) in formItems" :key="index">
|
<Component :is="item.component" v-for="(item, index) in formItems" :key="index" v-bind="item.props">
|
||||||
<FormRender v-for="(innerItem, innerIndex) in (item.content || [])" :key="innerIndex" :config="innerItem" />
|
<FormRender v-for="(innerItem, innerIndex) in (item.content || [])" :key="innerIndex" :config="innerItem" />
|
||||||
</Component>
|
</Component>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user