naive-ui/demo/documentation/components/confirm/enUS/index.md

93 lines
2.5 KiB
Markdown
Raw Normal View History

# Confirm
2020-01-30 18:48:38 +08:00
Before taking action, please confirm.
## Demos
```demo
basic
async
2019-12-06 17:44:58 +08:00
use-component
2020-01-30 18:48:38 +08:00
```
## API
2020-01-30 20:41:49 +08:00
### $NConfirm API
2020-02-04 13:23:36 +08:00
|Name|Type|Description|
2020-01-30 20:41:49 +08:00
|-|-|-|
|warning|`(options: ConfirmOption) : ConfirmEnvironment`||
|success|`(options: ConfirmOption) : ConfirmEnvironment`||
|error|`(options: ConfirmOption) : ConfirmEnvironment`||
2020-02-04 13:23:36 +08:00
|destroyAll|`(): void`||
2020-01-30 20:41:49 +08:00
### ConfirmOption API
|Name|Type|Default|Description|
|-|-|-|-|
|type|`'error \| 'success' \| 'warning'`|`'warning'`||
|title|`string`|`'Confirm'`||
|closable|`boolean`|`boolean`||
2020-02-04 13:23:36 +08:00
|icon|`function`|`null`|Should be a render function|
|negative-text|`string \| function`|`'Cancel'`|Can be a render function|
|positive-text|`string \| function`|`'Confirm'`|Can be a render function|
2020-01-30 20:41:49 +08:00
|content|`string`|`null`||
|show-icon|`boolean`|`true`||
|loading|`boolean`|`false`||
|bordered|`boolean`|`false`||
|onPositiveClick|`(hide: function): any`|`hide => hide()`||
|onNegativeClick|`(hide: function): any`|`hide => hide()`|
|onClose|`(hide: function): any`|`hide => hide()`||
### ConfirmEnvironment API
2020-01-30 23:35:57 +08:00
#### ConfirmEnvironment Properties
2020-02-04 13:23:36 +08:00
Properties of ConfirmEnvironment can be modified
|Name|Type|Description|
2020-01-30 18:48:38 +08:00
|-|-|-|
2020-01-30 23:35:57 +08:00
|type|`'error \| 'success' \| 'warning'`||
|title|`string`||
|closable|`boolean`||
2020-02-04 13:23:36 +08:00
|icon|`function`|Should be a render function|
|negative-text|`string \| function`|Can be a render function|
|positive-text|`string \| function`|Can be a render function|
2020-01-30 23:35:57 +08:00
|content|`string`||
|show-icon|`boolean`||
|loading|`boolean`||
|bordered|`boolean`||
|onPositiveClick|`(hide: function): any`||
|onNegativeClick|`(hide: function): any`||
|onClose|`(hide: function): any`||
#### ConfirmEnvironment Methods
2020-02-04 13:23:36 +08:00
|Name|Parameters|Description|
2020-01-30 23:35:57 +08:00
|-|-|-|
|hide|`()`|Call this method can close the confirm|
2020-01-30 18:48:38 +08:00
## Props
### Confirm Props
|Name|Type|Default|Description|
|-|-|-|-|
|type|`'error \| 'success' \| 'warning'`|`'warning'`||
|title|`string`|`'Confirm'`||
|closable|`boolean`|`boolean`||
2020-02-04 13:23:36 +08:00
|icon|`function`|`null`|Should be a render function|
|negative-text|`string \| function`|`'Cancel'`|Can be a render function|
|positive-text|`string \| function`|`'Confirm'`|Can be a render function|
2020-01-30 18:48:38 +08:00
|content|`string`|`null`||
|show-icon|`boolean`|`true`||
|loading|`boolean`|`false`||
|bordered|`boolean`|`false`||
## Events
### Confirm Events
|Name|Parameters|Description|
|-|-|-|
|positive-click|`()`||
|negative-click|`()`||
|close|`()`||
## Slots
### Confirm Slots
|Name|Parameters|Description|
|-|-|-|
|icon|`()`||
|header|`()`||
|default|`()`|Content|
|footer|`()`||