mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-22 00:39:43 +08:00
fixme
This commit is contained in:
@@ -15,6 +15,7 @@ const formItem = ref<RenderProps>(
|
||||
text: '',
|
||||
html: '',
|
||||
props: {},
|
||||
slots: [],
|
||||
content: [],
|
||||
},
|
||||
)
|
||||
@@ -24,6 +25,7 @@ const formData = ref<any>(elementProps.form || {})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 使用modelvalue -->
|
||||
<Component
|
||||
:is="formItem.component"
|
||||
v-if="!formItem.html && !!formItem.props?.modelvalue"
|
||||
@@ -31,6 +33,18 @@ const formData = ref<any>(elementProps.form || {})
|
||||
v-model:value="formData[formItem.props?.modelvalue]"
|
||||
>
|
||||
{{ formItem.text }}
|
||||
<!-- slots -->
|
||||
<template v-for="(content, name) in formItem.slots || []" :key="name" v-slot:[name]="{ _props }">
|
||||
<slot :name="name" v-bind="_props">
|
||||
<PageRender
|
||||
v-for="(slotItem, slotIndex) in content || []"
|
||||
:key="slotIndex"
|
||||
:config="slotItem"
|
||||
@action="emit('action')"
|
||||
/>
|
||||
</slot>
|
||||
</template>
|
||||
<!-- content -->
|
||||
<template v-for="(innerItem, innerIndex) in formItem.content || []" :key="innerIndex">
|
||||
<FormRender
|
||||
v-if="!!innerItem.props?.modelvalue"
|
||||
@@ -41,9 +55,23 @@ const formData = ref<any>(elementProps.form || {})
|
||||
<FormRender v-else v-model="formData[innerItem.props?.model]" :config="innerItem" :form="formData" />
|
||||
</template>
|
||||
</Component>
|
||||
<!-- 使用html -->
|
||||
<Component :is="formItem.component" v-else-if="formItem.html" v-bind="formItem.props" v-html="formItem.html" />
|
||||
<!-- 使用model -->
|
||||
<Component :is="formItem.component" v-else v-bind="formItem.props" v-model="formData[formItem.props?.model]">
|
||||
{{ formItem.text }}
|
||||
<!-- slots -->
|
||||
<template v-for="(content, name) in formItem.slots || []" :key="name" v-slot:[name]="{ _props }">
|
||||
<slot :name="name" v-bind="_props">
|
||||
<PageRender
|
||||
v-for="(slotItem, slotIndex) in content || []"
|
||||
:key="slotIndex"
|
||||
:config="slotItem"
|
||||
@action="emit('action')"
|
||||
/>
|
||||
</slot>
|
||||
</template>
|
||||
<!-- content -->
|
||||
<template v-for="(innerItem, innerIndex) in formItem.content || []" :key="innerIndex">
|
||||
<FormRender
|
||||
v-if="!!innerItem.props?.modelvalue"
|
||||
|
||||
Reference in New Issue
Block a user