fix(components): [popconfirm] text button type (#7526)

This commit is contained in:
JeremyWuuuuu 2022-05-06 13:17:35 +08:00 committed by GitHub
parent 7dc51f57e6
commit 119024eff0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 13 deletions

View File

@ -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: {

View File

@ -23,10 +23,20 @@
{{ title }}
</div>
<div :class="ns.e('action')">
<el-button size="small" :type="cancelButtonType" @click="cancel">
<el-button
size="small"
:type="cancelButtonType === 'text' ? '' : cancelButtonType"
:text="cancelButtonType === 'text'"
@click="cancel"
>
{{ finalCancelButtonText }}
</el-button>
<el-button size="small" :type="confirmButtonType" @click="confirm">
<el-button
size="small"
:type="confirmButtonType === 'text' ? '' : confirmButtonType"
:text="confirmButtonType === 'text'"
@click="confirm"
>
{{ finalConfirmButtonText }}
</el-button>
</div>