[new feature] Toast: add icon prop (#3485)

This commit is contained in:
neverland
2019-06-12 17:21:59 +08:00
committed by GitHub
parent 2d18f67a7d
commit 153fb9d69f
15 changed files with 185 additions and 48 deletions
+15
View File
@@ -32,6 +32,20 @@ Toast.success('Success');
Toast.fail('Fail');
```
### Custom Icon
```js
Toast({
text: 'Custom Icon',
icon: 'like-o'
});
Toast({
text: 'Custom Image',
icon: 'https://img.yzcdn.cn/vant/logo.png'
});
```
### Advanced Usage
```javascript
@@ -102,6 +116,7 @@ toast2.clear();
| type | Can be set to `loading` `success` `fail` `html` | `String` | `text` |
| position | Can be set to `top` `middle` `bottom` | `String` | `middle` |
| message | Message | `String` | `''` |
| icon | Custom icon | `String` | - |
| mask | Whether to show mask | `Boolean` | `false` |
| forbidClick | Whether to forbid click background | `Boolean` | `false` |
| loadingType | Loading icon type, can be set to `spinner` | `String` | `circular` |