mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-15 01:41:20 +08:00
c6b43df7b3
* refactor(components): [popconfirm] changed button type * docs: changes to attribute kebab case, add accepted values * fix: remove del tag * fix: remove del tag
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import { buttonTypes } from '@element-plus/components/button'
|
|
import { QuestionFilled } from '@element-plus/icons-vue'
|
|
import { buildProps, definePropType, iconPropType } from '@element-plus/utils'
|
|
import { useTooltipContentProps } from '@element-plus/components/tooltip'
|
|
import type { Component, ExtractPropTypes } from 'vue'
|
|
import type Popconfirm from './popconfirm.vue'
|
|
|
|
export const popconfirmProps = buildProps({
|
|
title: String,
|
|
confirmButtonText: String,
|
|
cancelButtonText: String,
|
|
confirmButtonType: {
|
|
type: String,
|
|
values: buttonTypes,
|
|
default: 'primary',
|
|
},
|
|
cancelButtonType: {
|
|
type: String,
|
|
values: buttonTypes,
|
|
default: 'text',
|
|
},
|
|
icon: {
|
|
type: iconPropType,
|
|
default: QuestionFilled as Component,
|
|
},
|
|
iconColor: {
|
|
type: String,
|
|
default: '#f90',
|
|
},
|
|
hideIcon: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
hideAfter: {
|
|
type: Number,
|
|
default: 200,
|
|
},
|
|
onConfirm: {
|
|
type: definePropType<(e: Event) => Promise<void> | void>(Function),
|
|
},
|
|
onCancel: {
|
|
type: definePropType<(e: Event) => Promise<void> | void>(Function),
|
|
},
|
|
teleported: useTooltipContentProps.teleported,
|
|
persistent: useTooltipContentProps.persistent,
|
|
} as const)
|
|
export type PopconfirmProps = ExtractPropTypes<typeof popconfirmProps>
|
|
|
|
export type PopconfirmInstance = InstanceType<typeof Popconfirm>
|