mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-08-28 11:37:29 +08:00
fix plugin form
This commit is contained in:
@@ -4,21 +4,25 @@ import { type PropType, ref } from 'vue'
|
|||||||
// 组件配置
|
// 组件配置
|
||||||
interface RenderProps {
|
interface RenderProps {
|
||||||
component: string
|
component: string
|
||||||
content: any
|
content?: any
|
||||||
props: any
|
props?: any
|
||||||
}
|
}
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const elementProps = defineProps({
|
const elementProps = defineProps({
|
||||||
config: Array as PropType<RenderProps[]>,
|
config: Object as PropType<RenderProps>,
|
||||||
})
|
})
|
||||||
|
|
||||||
// 配置表单
|
// 配置表单
|
||||||
const formItems = ref(elementProps.config)
|
const formItem = ref<RenderProps>(elementProps.config || {
|
||||||
|
component: 'div',
|
||||||
|
props: {},
|
||||||
|
content: [],
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Component :is="item.component" v-for="(item, index) in formItems" :key="index" v-bind="item.props">
|
<Component :is="formItem.component" v-bind="formItem.props">
|
||||||
<FormRender v-for="(innerItem, innerIndex) in (item.content || [])" :key="innerIndex" :config="innerItem" />
|
<FormRender v-for="(innerItem, innerIndex) in (formItem.content || [])" :key="innerIndex" :config="innerItem" />
|
||||||
</Component>
|
</Component>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user