From eab132609afca83af2706390ee7c1906c0dd658c Mon Sep 17 00:00:00 2001 From: Lysander <677@luqiqi.com> Date: Wed, 17 Apr 2024 15:50:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(baInput):=E5=8D=95=E5=A4=8D=E9=80=89?= =?UTF-8?q?=E6=A1=86=E6=94=AF=E6=8C=81=E6=8C=89=E9=92=AE=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/baInput/index.ts | 2 ++ web/src/components/baInput/index.vue | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/components/baInput/index.ts b/web/src/components/baInput/index.ts index ea98a971..db39f77a 100644 --- a/web/src/components/baInput/index.ts +++ b/web/src/components/baInput/index.ts @@ -164,6 +164,8 @@ export interface InputAttr { valueTitle?: string // 返回数据类型 dataType?: string + // 是否渲染为 button(radio 和 checkbox) + button?: boolean // 事件 onPreview?: Function onRemove?: Function diff --git a/web/src/components/baInput/index.vue b/web/src/components/baInput/index.vue index c4e16aaa..3ce21222 100644 --- a/web/src/components/baInput/index.vue +++ b/web/src/components/baInput/index.vue @@ -62,10 +62,11 @@ export default defineComponent({ console.warn('请传递 ' + props.type + '的 content') } let vNode: VNode[] = [] + const type = props.attr.button ? props.type + '-button' : props.type for (const key in props.data.content) { vNode.push( createVNode( - resolveComponent('el-' + props.type), + resolveComponent('el-' + type), { label: key, ...childrenAttr,