Compare commits

...

4 Commits

Author SHA1 Message Date
neverland
c3cdff303b
docs(changelog): vant@2.12.50 (#11058) 2022-09-17 14:10:16 +08:00
chenjiahan
3de20a74fa chore: release 2.12.50 2022-09-17 14:06:55 +08:00
neverland
1f29e79c46
types(ImagePreview): fix missing onScale type (#11057) 2022-09-17 14:05:29 +08:00
活轨
3e47f5b289
fix(Uploader): optimize image preview (#11044) 2022-09-17 13:50:38 +08:00
5 changed files with 21 additions and 2 deletions

View File

@ -16,6 +16,15 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/).
## Details
### [v2.12.50](https://github.com/vant-ui/vant/compare/v2.12.49...v2.12.50)
`2022-09-17`
**Bug Fixes**
- Uploader: optimize image preview [#11044](https://github.com/vant-ui/vant/issues/11044)
- ImagePreview: fix missing onScale type [#11057](https://github.com/vant-ui/vant/issues/11057)
### [v2.12.49](https://github.com/vant-ui/vant/compare/v2.12.48...v2.12.49)
`2022-09-05`

View File

@ -25,6 +25,15 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
## 更新内容
### [v2.12.50](https://github.com/vant-ui/vant/compare/v2.12.49...v2.12.50)
`2022-09-17`
**Bug Fixes**
- Uploader: 修复点击预览大图时会展示上传失败的图片的问题 [#11044](https://github.com/vant-ui/vant/issues/11044)
- ImagePreview: 修复缺少 onScale 类型定义的问题 [#11057](https://github.com/vant-ui/vant/issues/11057)
### [v2.12.49](https://github.com/vant-ui/vant/compare/v2.12.48...v2.12.49)
`2022-09-05`

View File

@ -1,6 +1,6 @@
{
"name": "vant",
"version": "2.12.49",
"version": "2.12.50",
"description": "Mobile UI Components built on Vue",
"main": "lib/index.js",
"module": "es/index.js",

View File

@ -268,7 +268,7 @@ export default createComponent({
const imageFiles = this.fileList.filter((item) => isImageFile(item));
const imageContents = imageFiles.map((item) => {
if (item.file && !item.url) {
if (item.file && !item.url && item.status !== 'failed') {
item.url = URL.createObjectURL(item.file);
this.urls.push(item.url);
}

View File

@ -23,6 +23,7 @@ export type ImagePreviewOptions =
closeIconPosition?: string;
getContainer?: string | (() => Element);
onClose?(): void;
onScale?(data: { index: number; scale: number }): void;
onChange?(index: number): void;
swipeTo?(index: number, options?: SwipeToOptions): void;
};