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
|-|-|-|
2020-02-05 12:21:18 +08:00
|warning|`(options: ConfirmOption) => ConfirmEnvironment`||
|success|`(options: ConfirmOption) => ConfirmEnvironment`||
|error|`(options: ConfirmOption) => ConfirmEnvironment`||
|destroyAll|`() => void`||
2020-01-30 20:41:49 +08:00
### ConfirmOption API
|Name|Type|Default|Description|
|-|-|-|-|
|type|`'error \| 'success' \| 'warning'`|`'warning'`||
|title|`string \| function`|`null`|Can be a render function.|
2020-01-30 20:41:49 +08:00
|closable|`boolean`|`boolean`||
|icon|`function`|`null`|Should be a render function.|
|negative-text|`string`|`'Cancel'`||
|positive-text|`string`|`'Confirm'`||
|content|`string \| function`|`null`|Can be a render function.|
2020-01-30 20:41:49 +08:00
|show-icon|`boolean`|`true`||
|loading|`boolean`|`false`||
|bordered|`boolean`|`false`||
2020-02-05 12:21:18 +08:00
|onPositiveClick|`(hide: function) => any`|`hide => hide()`||
|onNegativeClick|`(hide: function) => any`|`hide => hide()`|
|onClose|`(hide: function) => any`|`hide => hide()`||
2020-01-30 20:41:49 +08:00
### 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 \| function`|Can be a render function.|
2020-01-30 23:35:57 +08:00
|closable|`boolean`||
2020-02-04 13:23:36 +08:00
|icon|`function`|Should be a render function|
|negative-text|`string`||
|positive-text|`string`||
|content|`string \| function`|Can be a render function.|
2020-01-30 23:35:57 +08:00
|show-icon|`boolean`||
|loading|`boolean`||
|bordered|`boolean`||
2020-02-05 12:21:18 +08:00
|onPositiveClick|`(hide: function) => any`||
|onNegativeClick|`(hide: function) => any`||
|onClose|`(hide: function) => any`||
2020-01-30 23:35:57 +08:00
#### 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 \| function`|`null`|Can be a render function.|
2020-01-30 18:48:38 +08:00
|closable|`boolean`|`boolean`||
2020-02-04 13:23:36 +08:00
|icon|`function`|`null`|Should be a render function|
|negative-text|`string`|`null`||
|positive-text|`string`|`null`||
|content|`string \| function`|`null`|Can be a render function.|
2020-01-30 18:48:38 +08:00
|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|
2020-02-04 14:55:55 +08:00
|action|`()`||
2020-01-30 18:48:38 +08:00