2021-10-22 19:32:39 +08:00
|
|
|
---
|
2021-10-25 15:21:08 +08:00
|
|
|
title: Popconfirm
|
2021-10-22 19:32:39 +08:00
|
|
|
lang: en-US
|
|
|
|
---
|
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
# Popconfirm
|
2020-08-13 15:18:26 +08:00
|
|
|
|
|
|
|
A simple confirmation dialog of an element click action.
|
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
## Basic usage
|
2020-08-13 15:18:26 +08:00
|
|
|
|
|
|
|
Popconfirm is similar to Popover. So for some duplicated attributes, please refer to the documentation of Popover.
|
|
|
|
|
|
|
|
:::demo Only `title` attribute is avaliable in Popconfirm, `content` will be ignored.
|
2021-09-04 19:29:28 +08:00
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
popconfirm/basic-usage
|
2020-08-13 15:18:26 +08:00
|
|
|
|
2021-09-04 19:29:28 +08:00
|
|
|
:::
|
2021-08-18 11:06:22 +08:00
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
## Customize
|
2021-09-04 19:29:28 +08:00
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
You can customize Popconfirm like:
|
2021-09-17 11:22:41 +08:00
|
|
|
|
2020-08-13 15:18:26 +08:00
|
|
|
:::demo
|
2021-09-04 19:29:28 +08:00
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
popconfirm/customize
|
2021-09-04 19:29:28 +08:00
|
|
|
|
2020-08-13 15:18:26 +08:00
|
|
|
:::
|
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
## Trigger event
|
2021-09-04 19:29:28 +08:00
|
|
|
|
2021-08-18 11:06:22 +08:00
|
|
|
Click the button to trigger the event
|
|
|
|
|
|
|
|
:::demo
|
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
popconfirm/trigger-event
|
2021-08-18 11:06:22 +08:00
|
|
|
|
|
|
|
:::
|
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
## Attributes
|
2021-09-04 19:29:28 +08:00
|
|
|
|
2022-08-29 11:23:35 +08:00
|
|
|
| Attribute | Description | Type | Accepted Values | Default |
|
|
|
|
| ------------------- | ----------------------------------------------------------------------------------- | --------------------- | -------------------------------------------------- | --------------- |
|
|
|
|
| title | Title | String | — | — |
|
|
|
|
| confirm-button-text | Confirm button text | String | — | — |
|
|
|
|
| cancel-button-text | Cancel button text | String | — | — |
|
|
|
|
| confirm-button-type | Confirm button type | String | primary / success / warning / danger / info / text | primary |
|
|
|
|
| cancel-button-type | Cancel button type | String | primary / success / warning / danger / info / text | text |
|
|
|
|
| icon | Icon Component | `string \| Component` | — | QuestionFilled |
|
|
|
|
| icon-color | Icon color | String | — | #f90 |
|
|
|
|
| hide-icon | is hide Icon | Boolean | — | false |
|
|
|
|
| teleported | whether popconfirm is teleported to the body | boolean | true / false | true |
|
|
|
|
| persistent | when popconfirm inactive and `persistent` is `false` , popconfirm will be destroyed | boolean | — | false |
|
|
|
|
| width | popconfirm width | string/number | - | Min width 150px |
|
2020-08-13 15:18:26 +08:00
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
## Slots
|
2021-09-04 19:29:28 +08:00
|
|
|
|
|
|
|
| Name | Description |
|
|
|
|
| --------- | ------------------------------------- |
|
2020-08-13 15:18:26 +08:00
|
|
|
| reference | HTML element that triggers Popconfirm |
|
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
## Events
|
2021-09-04 19:29:28 +08:00
|
|
|
|
|
|
|
| Event Name | Description | Parameters |
|
|
|
|
| ---------- | ---------------------------------- | ---------- |
|
|
|
|
| confirm | triggers when click confirm button | — |
|
|
|
|
| cancel | triggers when click cancel button | — |
|