Compare commits

...

4 Commits

Author SHA1 Message Date
chenjiahan
e3238d8fa1 docs(changelog): 2.12.39 2022-01-15 20:30:10 +08:00
chenjiahan
02b928086c chore: release 2.12.39 2022-01-15 20:12:41 +08:00
neverland
708c3af769
fix(ImagePreview): incorrectly closed after zooming (#10191) 2022-01-15 20:06:04 +08:00
neverland
6ed16c0770
fix(NavBar): get correct height in mobile safari (#10190) 2022-01-15 20:01:55 +08:00
5 changed files with 38 additions and 5 deletions

View File

@ -16,6 +16,17 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/).
## Details
### [v2.12.39](https://github.com/youzan/vant/compare/v2.12.38...v2.12.39)
`2022-01-15`
**Bug Fixes**
- DatetimePicker: error in some edge cases [#10186](https://github.com/youzan/vant/issues/10186)
- ImagePreview: incorrectly closed after zooming [#10191](https://github.com/youzan/vant/issues/10191)
- NavBar: get correct height in mobile safari [#10190](https://github.com/youzan/vant/issues/10190)
- Tabbar: get correct height in mobile safari [#10185](https://github.com/youzan/vant/issues/10185)
### [v2.12.38](https://github.com/youzan/vant/compare/v2.12.37...v2.12.38)
`2022-01-10`

View File

@ -16,6 +16,17 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
## 更新内容
### [v2.12.39](https://github.com/youzan/vant/compare/v2.12.38...v2.12.39)
`2022-01-15`
**Bug Fixes**
- DatetimePicker: 修复边界情况下可能报错的问题 [#10186](https://github.com/youzan/vant/issues/10186)
- ImagePreview: 修复快速缩放导致预览关闭的问题 [#10191](https://github.com/youzan/vant/issues/10191)
- NavBar: 修复在 safari 上占位元素高度错误的问题 [#10190](https://github.com/youzan/vant/issues/10190)
- Tabbar: 修复在 safari 上占位元素高度错误的问题 [#10185](https://github.com/youzan/vant/issues/10185)
### [v2.12.38](https://github.com/youzan/vant/compare/v2.12.37...v2.12.38)
`2022-01-10`

View File

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

View File

@ -139,11 +139,12 @@ export default {
this.touchStart(event);
this.touchStartTime = new Date();
this.fingerNum = touches.length;
this.startMoveX = this.moveX;
this.startMoveY = this.moveY;
this.moving = touches.length === 1 && this.scale !== 1;
this.zooming = touches.length === 2 && !offsetX;
this.moving = this.fingerNum === 1 && this.scale !== 1;
this.zooming = this.fingerNum === 2 && !offsetX;
if (this.zooming) {
this.startScale = this.scale;
@ -216,10 +217,14 @@ export default {
},
checkTap() {
if (this.fingerNum > 1) {
return;
}
const { offsetX = 0, offsetY = 0 } = this;
const deltaTime = new Date() - this.touchStartTime;
const TAP_TIME = 250;
const TAP_OFFSET = 10;
const TAP_OFFSET = 5;
if (
offsetX < TAP_OFFSET &&

View File

@ -31,7 +31,13 @@ export default createComponent({
mounted() {
if (this.placeholder && this.fixed) {
this.height = this.$refs.navBar.getBoundingClientRect().height;
const setHeight = () => {
this.height = this.$refs.navBar.getBoundingClientRect().height;
};
setHeight();
// https://github.com/youzan/vant/issues/10131
setTimeout(setHeight, 100);
}
},