From 119024eff0465b76dce0197b8d94aa976644a242 Mon Sep 17 00:00:00 2001 From: JeremyWuuuuu <15975785+JeremyWuuuuu@users.noreply.github.com> Date: Fri, 6 May 2022 13:17:35 +0800 Subject: [PATCH] fix(components): [popconfirm] text button type (#7526) --- .../components/popconfirm/src/popconfirm.ts | 18 +++++++----------- .../components/popconfirm/src/popconfirm.vue | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/packages/components/popconfirm/src/popconfirm.ts b/packages/components/popconfirm/src/popconfirm.ts index 4a89bf6731..9186fd6f67 100644 --- a/packages/components/popconfirm/src/popconfirm.ts +++ b/packages/components/popconfirm/src/popconfirm.ts @@ -4,24 +4,20 @@ import { buildProps, definePropType, iconPropType } from '@element-plus/utils' import { useTooltipContentProps } from '@element-plus/components/tooltip' import type { Component, ExtractPropTypes } from 'vue' +const popConfirmButtonTypes = [...buttonTypes, 'text'] as const + export const popconfirmProps = buildProps({ - title: { - type: String, - }, - confirmButtonText: { - type: String, - }, - cancelButtonText: { - type: String, - }, + title: String, + confirmButtonText: String, + cancelButtonText: String, confirmButtonType: { type: String, - values: buttonTypes, + values: popConfirmButtonTypes, default: 'primary', }, cancelButtonType: { type: String, - values: buttonTypes, + values: popConfirmButtonTypes, default: 'text', }, icon: { diff --git a/packages/components/popconfirm/src/popconfirm.vue b/packages/components/popconfirm/src/popconfirm.vue index b1b705b712..a92c66d9ea 100644 --- a/packages/components/popconfirm/src/popconfirm.vue +++ b/packages/components/popconfirm/src/popconfirm.vue @@ -23,10 +23,20 @@ {{ title }}
- + {{ finalCancelButtonText }} - + {{ finalConfirmButtonText }}