mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 07:28:37 +08:00
feat: 插件页面支持slot
This commit is contained in:
@@ -7,6 +7,7 @@ interface RenderProps {
|
|||||||
text: string
|
text: string
|
||||||
html: string
|
html: string
|
||||||
content?: any
|
content?: any
|
||||||
|
slots?: any
|
||||||
props?: any
|
props?: any
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,6 +23,7 @@ const formItem = ref<RenderProps>(elementProps.config ?? {
|
|||||||
html: '',
|
html: '',
|
||||||
props: {},
|
props: {},
|
||||||
content: [],
|
content: [],
|
||||||
|
slots: {},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -32,6 +34,15 @@ const formItem = ref<RenderProps>(elementProps.config ?? {
|
|||||||
v-bind="formItem.props"
|
v-bind="formItem.props"
|
||||||
>
|
>
|
||||||
{{ formItem.text }}
|
{{ formItem.text }}
|
||||||
|
<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"
|
||||||
|
/>
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
<PageRender
|
<PageRender
|
||||||
v-for="(innerItem, innerIndex) in (formItem.content || [])"
|
v-for="(innerItem, innerIndex) in (formItem.content || [])"
|
||||||
:key="innerIndex"
|
:key="innerIndex"
|
||||||
|
|||||||
Reference in New Issue
Block a user