[new feature] Uploader: support bind v-model

This commit is contained in:
陈嘉涵
2019-06-05 15:10:48 +08:00
parent 351e642e6d
commit b1111b4026
7 changed files with 149 additions and 45 deletions
+29 -3
View File
@@ -13,7 +13,7 @@ Vue.use(Uploader);
### Basic Usage
```html
<van-uploader preview :after-read="afterRead" />
<van-uploader :after-read="afterRead" />
```
```javascript
@@ -26,16 +26,42 @@ export default {
};
```
### Preview Image
```html
<van-uploader v-model="fileList" multiple />
```
```javascript
export default {
data() {
return {
fileList: []
}
}
};
```
### Max Count
```html
<van-uploader
preview
v-model="fileList"
multiple
:max-count="2"
/>
```
```javascript
export default {
data() {
return {
fileList: []
}
}
};
```
### Upload Style
```html
@@ -52,7 +78,7 @@ export default {
|------|------|------|------|
| name | Input name | `String` | - |
| accept | Accepted file type | `String` | `image/*` |
| preview | Whether to show image preview | `Boolean` | `false` |
| preview-image | Whether to show image preview | `Boolean` | `true` |
| preview-size | Size of preview image | `String | Number` | `80px` |
| multiple | Whether to enable multiple selection pictures | `Boolean` | `false` |
| disabled | Whether to disabled the upload | `Boolean` | `false` |