mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-07 16:56:40 +08:00
fixme
This commit is contained in:
@@ -5,7 +5,6 @@ import type { ThemeSwitcherTheme } from '@layouts/types'
|
|||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { checkPrefersColorSchemeIsDark } from '@/@core/utils'
|
import { checkPrefersColorSchemeIsDark } from '@/@core/utils'
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import { VAceEditor } from 'vue3-ace-editor'
|
|
||||||
|
|
||||||
// 显示器宽度
|
// 显示器宽度
|
||||||
const display = useDisplay()
|
const display = useDisplay()
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ const formItem = ref<RenderProps>(
|
|||||||
text: '',
|
text: '',
|
||||||
html: '',
|
html: '',
|
||||||
props: {},
|
props: {},
|
||||||
|
slots: [],
|
||||||
content: [],
|
content: [],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -24,6 +25,7 @@ const formData = ref<any>(elementProps.form || {})
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<!-- 使用modelvalue -->
|
||||||
<Component
|
<Component
|
||||||
:is="formItem.component"
|
:is="formItem.component"
|
||||||
v-if="!formItem.html && !!formItem.props?.modelvalue"
|
v-if="!formItem.html && !!formItem.props?.modelvalue"
|
||||||
@@ -31,6 +33,18 @@ const formData = ref<any>(elementProps.form || {})
|
|||||||
v-model:value="formData[formItem.props?.modelvalue]"
|
v-model:value="formData[formItem.props?.modelvalue]"
|
||||||
>
|
>
|
||||||
{{ formItem.text }}
|
{{ 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">
|
<template v-for="(innerItem, innerIndex) in formItem.content || []" :key="innerIndex">
|
||||||
<FormRender
|
<FormRender
|
||||||
v-if="!!innerItem.props?.modelvalue"
|
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" />
|
<FormRender v-else v-model="formData[innerItem.props?.model]" :config="innerItem" :form="formData" />
|
||||||
</template>
|
</template>
|
||||||
</Component>
|
</Component>
|
||||||
|
<!-- 使用html -->
|
||||||
<Component :is="formItem.component" v-else-if="formItem.html" v-bind="formItem.props" v-html="formItem.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]">
|
<Component :is="formItem.component" v-else v-bind="formItem.props" v-model="formData[formItem.props?.model]">
|
||||||
{{ formItem.text }}
|
{{ 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">
|
<template v-for="(innerItem, innerIndex) in formItem.content || []" :key="innerIndex">
|
||||||
<FormRender
|
<FormRender
|
||||||
v-if="!!innerItem.props?.modelvalue"
|
v-if="!!innerItem.props?.modelvalue"
|
||||||
|
|||||||
Reference in New Issue
Block a user