feat(Notify): add type prop (#4237)

This commit is contained in:
neverland
2019-08-26 09:48:43 +08:00
committed by GitHub
parent ae53f9b58f
commit 10b52963b8
11 changed files with 151 additions and 44 deletions
+19 -4
View File
@@ -17,13 +17,27 @@ Vue.use(Notify);
Notify('Notify Message');
```
### Custom Config
### Notify Type
```js
Notify({ type: 'primary', message: 'Notify Message' });
Notify({ type: 'success', message: 'Notify Message' });
Notify({ type: 'danger', message: 'Notify Message' });
Notify({ type: 'warning', message: 'Notify Message' });
```
### Custom Notify
```js
Notify({
message: 'Notify Message',
duration: 1000,
background: '#1989fa'
message: 'Custom Color',
color: '#ad0000',
background: '#ffe1e1'
});
Notify({
message: 'Custom Duration',
duration: 1000
});
```
@@ -54,6 +68,7 @@ export default {
| Attribute | Description | Type | Default |
|------|------|------|------|
| type | Can be set to `primary` `info` `warning` | `string` | `danger` |
| message | Message | `string` | - |
| duration | Duration(ms), won't disappear if value is 0 | `number` | `3000` |
| color | Message color | `string` | `#fff` | |