mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
feat(components): [el-message] & [el-notification] appendTo option added (#4012)
* feat(components): [el-message] & [el-notification] appendTo option added * fix(components): unit test and replaced warn with debugWarn
This commit is contained in:
@@ -77,18 +77,19 @@ In this case you should call `ElMessage(options)`. We have also registered metho
|
||||
|
||||
## Options
|
||||
|
||||
| Attribute | Description | Type | Accepted Values | Default |
|
||||
| ------------------------ | ------------------------------------------------------------------------------ | ------------------ | -------------------------- | ------- |
|
||||
| message | message text | string / VNode | — | — |
|
||||
| type | message type | string | success/warning/info/error | info |
|
||||
| icon | custom icon component, overrides `type` | string / Component | — | — |
|
||||
| dangerouslyUseHTMLString | whether `message` is treated as HTML string | boolean | — | false |
|
||||
| custom-class | custom class name for Message | string | — | — |
|
||||
| duration | display duration, millisecond. If set to 0, it will not turn off automatically | number | — | 3000 |
|
||||
| show-close | whether to show a close button | boolean | — | false |
|
||||
| center | whether to center the text | boolean | — | false |
|
||||
| on-close | callback function when closed with the message instance as the parameter | function | — | — |
|
||||
| offset | set the distance to the top of viewport | number | — | 20 |
|
||||
| Attribute | Description | Type | Accepted Values | Default |
|
||||
| ------------------------ | ------------------------------------------------------------------------------ | -------------------- | -------------------------- | ------------- |
|
||||
| message | message text | string / VNode | — | — |
|
||||
| type | message type | string | success/warning/info/error | info |
|
||||
| icon-class | custom icon's class, overrides `type` | string | — | — |
|
||||
| dangerouslyUseHTMLString | whether `message` is treated as HTML string | boolean | — | false |
|
||||
| custom-class | custom class name for Message | string | — | — |
|
||||
| duration | display duration, millisecond. If set to 0, it will not turn off automatically | number | — | 3000 |
|
||||
| show-close | whether to show a close button | boolean | — | false |
|
||||
| center | whether to center the text | boolean | — | false |
|
||||
| on-close | callback function when closed with the message instance as the parameter | function | — | — |
|
||||
| offset | set the distance to the top of viewport | number | — | 20 |
|
||||
| appendTo | set the root element for the message | string / HTMLElement | - | document.body |
|
||||
|
||||
## Methods
|
||||
|
||||
|
||||
@@ -85,20 +85,21 @@ In this case you should call `ElNotification(options)`. We have also registered
|
||||
|
||||
## Options
|
||||
|
||||
| Attribute | Description | Type | Accepted Values | Default |
|
||||
| ------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------ | ------------------------------------------- | --------- |
|
||||
| title | title | string | — | — |
|
||||
| message | description text | string/Vue.VNode | — | — |
|
||||
| dangerouslyUseHTMLString | whether `message` is treated as HTML string | boolean | — | false |
|
||||
| type | notification type | string | success/warning/info/error | — |
|
||||
| icon | custom icon component. It will be overridden by `type` | string / Component | — | — |
|
||||
| customClass | custom class name for Notification | string | — | — |
|
||||
| duration | duration before close. It will not automatically close if set 0 | number | — | 4500 |
|
||||
| position | custom position | string | top-right/top-left/bottom-right/bottom-left | top-right |
|
||||
| showClose | whether to show a close button | boolean | — | true |
|
||||
| onClose | callback function when closed | function | — | — |
|
||||
| onClick | callback function when notification clicked | function | — | — |
|
||||
| offset | offset from the top edge of the screen. Every Notification instance of the same moment should have the same offset | number | — | 0 |
|
||||
| Attribute | Description | Type | Accepted Values | Default |
|
||||
| ------------------------ | ------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------- | ------------- |
|
||||
| title | title | string | — | — |
|
||||
| message | description text | string/Vue.VNode | — | — |
|
||||
| dangerouslyUseHTMLString | whether `message` is treated as HTML string | boolean | — | false |
|
||||
| type | notification type | string | success/warning/info/error | — |
|
||||
| iconClass | custom icon's class. It will be overridden by `type` | string | — | — |
|
||||
| customClass | custom class name for Notification | string | — | — |
|
||||
| duration | duration before close. It will not automatically close if set 0 | number | — | 4500 |
|
||||
| position | custom position | string | top-right/top-left/bottom-right/bottom-left | top-right |
|
||||
| showClose | whether to show a close button | boolean | — | true |
|
||||
| onClose | callback function when closed | function | — | — |
|
||||
| onClick | callback function when notification clicked | function | — | — |
|
||||
| offset | offset from the top edge of the screen. Every Notification instance of the same moment should have the same offset | number | — | 0 |
|
||||
| appendTo | set the root element for the notification | string / HTMLElement | - | document.body |
|
||||
|
||||
## Methods
|
||||
|
||||
|
||||
Reference in New Issue
Block a user