feat(uploader): add single uploader preview image style (#7731)

This commit is contained in:
Jontyy
2020-12-17 11:05:22 +08:00
committed by GitHub
parent 6e8ca9fd8b
commit b41d95b074
6 changed files with 194 additions and 25 deletions
+35
View File
@@ -223,6 +223,41 @@ Use `disabled` prop to disable uploader.
<van-uploader disabled />
```
### Customize Single Preview Image Style
```html
<van-uploader v-model="fileList" :deletable="false" />
```
```js
import { ref } from 'vue';
import { Toast } from 'vant';
export default {
setup() {
const fileList = ref([
{ url: 'https://img.yzcdn.cn/vant/leaf.jpg' },
{
url: 'https://img.yzcdn.cn/vant/sand.jpg',
deletable: true,
beforeDelete: () => {
Toast('Customize the events and styles of a single preview image');
},
},
{
url: 'https://img.yzcdn.cn/vant/tree.jpg',
deletable: true,
imageFit: 'contain',
previewSize: 120,
},
]);
return {
fileList:
};
}
};
```
## API
### Props