From c2463fc4502acbd9274f1080f86a74ca43951927 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Sat, 23 Nov 2024 23:05:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20GiForm=20=E6=94=AF=E6=8C=81=20label=20?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=B8=B2=E6=9F=93=EF=BC=8C=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E6=8F=92=E6=A7=BD=E8=87=AA=E5=AE=9A=E4=B9=89=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=EF=BC=88=E5=90=8C=E6=AD=A5=20GiDemo=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/GiForm/src/GiForm.vue | 13 +++++++++++-- src/components/GiForm/src/type.ts | 5 ++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/GiForm/src/GiForm.vue b/src/components/GiForm/src/GiForm.vue index 1208b7d..84e6060 100644 --- a/src/components/GiForm/src/GiForm.vue +++ b/src/components/GiForm/src/GiForm.vue @@ -7,9 +7,13 @@ :span="item.span || options.gridItem?.span" > + + > + + {{ item.label }} diff --git a/src/components/GiForm/src/type.ts b/src/components/GiForm/src/type.ts index ebfa6e5..97e9504 100644 --- a/src/components/GiForm/src/type.ts +++ b/src/components/GiForm/src/type.ts @@ -1,4 +1,5 @@ import type * as A from '@arco-design/web-vue' +import type { VNode } from 'vue' export type FormType = | 'input' @@ -69,7 +70,7 @@ export type ColumnsItemOptionsOrData = export interface ColumnsItem { type?: FormType // 类型 - label?: A.FormItemInstance['label'] // 标签 + label?: A.FormItemInstance['label'] | (() => VNode) // 标签 field: A.FormItemInstance['field'] // 字段(必须唯一) gridItemProps?: A.GridItemProps formItemProps?: Omit // a-form-item的props @@ -106,6 +107,8 @@ export interface ColumnsItem { resultFormat?: ColumnsItemFormat // 结果集格式化 init?: boolean // 初始化请求 cascader?: string[] // 级联的field字段列表 + slots?: Partial VNode)>> + formItemSlots?: Partial VNode)>> } export interface Options {