This commit is contained in:
jxxghp
2023-09-28 12:52:44 +08:00
parent 6905be1bcd
commit 065c9053da
4 changed files with 12 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "moviepilot", "name": "moviepilot",
"version": "1.2.6", "version": "1.2.6-1",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite --host", "dev": "vite --host",
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+10 -1
View File
@@ -5,6 +5,7 @@ import { type PropType, ref } from 'vue'
interface RenderProps { interface RenderProps {
component: string component: string
text: string text: string
html: string
content?: any content?: any
props?: any props?: any
} }
@@ -16,9 +17,10 @@ const elementProps = defineProps({
}) })
// 配置元素 // 配置元素
const formItem = ref<RenderProps>(elementProps.config || { const formItem = ref<RenderProps>(elementProps.config ?? {
component: 'div', component: 'div',
text: '', text: '',
html: '',
props: {}, props: {},
content: [], content: [],
}) })
@@ -30,6 +32,7 @@ const formData = ref<any>(elementProps.form || {})
<template> <template>
<Component <Component
:is="formItem.component" :is="formItem.component"
v-if="!formItem.html"
v-bind="formItem.props" v-bind="formItem.props"
v-model="formData[formItem.props?.model || '']" v-model="formData[formItem.props?.model || '']"
> >
@@ -42,4 +45,10 @@ const formData = ref<any>(elementProps.form || {})
:form="formData" :form="formData"
/> />
</Component> </Component>
<Component
:is="formItem.component"
v-if="formItem.html"
v-bind="formItem.props"
v-html="formItem.html"
/>
</template> </template>
+1 -2
View File
@@ -13,11 +13,10 @@ interface RenderProps {
// 输入参数 // 输入参数
const elementProps = defineProps({ const elementProps = defineProps({
config: Object as PropType<RenderProps>, config: Object as PropType<RenderProps>,
handler: Boolean,
}) })
// 配置元素 // 配置元素
const formItem = ref<RenderProps>(elementProps.config || { const formItem = ref<RenderProps>(elementProps.config ?? {
component: 'div', component: 'div',
text: '', text: '',
html: '', html: '',