element-plus/packages/components/popconfirm/src/popconfirm.ts
류한경 c6b43df7b3
refactor(components): [popconfirm] changed button type (#8436)
* refactor(components): [popconfirm] changed button type

* docs: changes to attribute kebab case, add accepted values ​

* fix: remove del tag

* fix: remove del tag
2022-06-24 13:58:51 +09:00

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>