This commit is contained in:
zhangjianjun 2026-04-01 10:24:36 +08:00
parent f6a41d722f
commit 2bba341755
1 changed files with 12 additions and 4 deletions

View File

@ -67,7 +67,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, watch, defineComponent, h, type PropType, type VNode, type Component } from 'vue' import { ref, computed, watch, defineComponent, h, type PropType, type VNode, type Component } from 'vue'
import { Close, FullScreen, CopyDocument, Plus, Delete, Promotion } from '@element-plus/icons-vue' import { Close, FullScreen, CopyDocument, Plus, Delete, Promotion, UploadFilled } from '@element-plus/icons-vue'
import { import {
ElFormItem, ElInput, ElInputNumber, ElSwitch, ElButton, ElFormItem, ElInput, ElInputNumber, ElSwitch, ElButton,
ElCollapse, ElCollapseItem, ElIcon, ElMessage ElCollapse, ElCollapseItem, ElIcon, ElMessage
@ -289,7 +289,7 @@ const NodeEditor: Component = defineComponent({
lang: { type: String, default: '' }, lang: { type: String, default: '' },
zhParent: { type: Object as PropType<any>, default: undefined }, zhParent: { type: Object as PropType<any>, default: undefined },
}, },
setup(p) { setup(p: any) {
return () => { return () => {
const value = p.parent[p.fieldKey] const value = p.parent[p.fieldKey]
const key = p.fieldKey const key = p.fieldKey
@ -344,11 +344,19 @@ const NodeEditor: Component = defineComponent({
}, },
}) })
} }
const inputNode = h(ElInput, { const inputNode = [
h(ElInput, {
modelValue: value, modelValue: value,
...({ type: 'textarea', autosize: { minRows: 1, maxRows: 6 } }), ...({ type: 'textarea', autosize: { minRows: 1, maxRows: 6 } }),
'onUpdate:modelValue': (v: string) => { p.parent[key] = v }, 'onUpdate:modelValue': (v: string) => { p.parent[key] = v },
}) style: { width: '90%', marginRight: '5px' },
}),
p.parent[key] === '' && h(ElButton, {
size: 'small', type: 'primary',
title: '切换为图片上传框',
onClick: () => p.parent[key] = '1.png',
}, () => h(ElIcon, { size: 14 }, () => h(UploadFilled))),
]
const wangEditor = h(WangEditor, { const wangEditor = h(WangEditor, {
content: value, content: value,