|
44 | 44 | notifiCustomIcon() {
|
45 | 45 | this.$notify({
|
46 | 46 | title: 'Info',
|
47 |
| - message: '这是一条没有关闭按钮的消息', |
| 47 | + message: '自定义图标', |
48 | 48 | iconClass: ['pyui-icons', 'py-icon-heart-fill'],
|
49 | 49 | });
|
50 | 50 | },
|
|
138 | 138 |
|
139 | 139 | :::
|
140 | 140 |
|
141 |
| -### 带有倾向性 |
| 141 | +### 带有图标 |
142 | 142 |
|
143 |
| -带有 icon,常用来显示「成功、警告、消息、错误」类的系统消息 |
| 143 | +带有 icon,常用来显示「成功、警告、消息、错误」类的系统消息,或者显示用户自定义图标类 |
144 | 144 |
|
145 |
| -:::demo Element 为 Notification 组件准备了四种通知类型:success, warning, info, error。通过type字段来设置,除此以外的值将被忽略。同时,我们也为 Notification 的各种 type 注册了方法,可以在不传入type字段的情况下像notifiInfo和notifiError那样直接调用。自定义图标需要以数组形式传入图标样式。 |
| 145 | +:::demo Notification 组件准备了四种通知类型:success, warning, info, error。通过type字段来设置,除此以外的值将被忽略。同时,我们也为 Notification 的各种 type 注册了方法,可以在不传入type字段的情况下像notifiInfo和notifiError那样直接调用。自定义图标需要以数组形式传入图标Class。注意:如果定义了以上四种类型的type,则传入的自定义图标无效,因为type属性优先度更高。 |
146 | 146 |
|
147 | 147 | ```html
|
148 | 148 | <template>
|
|
182 | 182 | notifiCustomIcon() {
|
183 | 183 | this.$notify({
|
184 | 184 | title: 'Info',
|
185 |
| - message: '这是一条没有关闭按钮的消息', |
| 185 | + message: '自定义图标', |
186 | 186 | iconClass: ['pyui-icons', 'py-icon-heart-fill'],
|
187 | 187 | });
|
188 | 188 | }
|
@@ -336,8 +336,8 @@ message 属性支持传入 HTML 片段
|
336 | 336 | | message | 说明文字 | string | — | — |
|
337 | 337 | | dangerouslyUseHTMLString | 是否将 message 属性作为 HTML 片段处理 | boolean | — | false |
|
338 | 338 | | type | 主题样式,如果不在可选值内将被忽略 | string | success / warning / info / error | — |
|
339 |
| -| iconClass | 自定义图标的类名。若设置了 type,则 iconClass 会被覆盖 | string[] | — | — | |
340 |
| -| customClass | 自定义类名 | string | — | — | |
| 339 | +| iconClass | 自定义图标的类名。若设置了 type,则 iconClass 会被覆盖 | string[ ] | — | — | |
| 340 | +| customClass | 自定义类名 | string | — | — | |
341 | 341 | | duration | 显示时间, 毫秒。设为 0 则不会自动关闭 | number | — | 4500 |
|
342 | 342 | | position | 自定义弹出位置 | string | top-right / top-left / bottom-right / bottom-left | top-right |
|
343 | 343 | | showClose | 是否显示关闭按钮 | boolean | — | true |
|
|
0 commit comments