Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add enableDoubleScale attribute #12360

Merged
merged 4 commits into from
Oct 14, 2023
Merged

feat: add enableDoubleScale attribute #12360

merged 4 commits into from
Oct 14, 2023

Conversation

coderXMin
Copy link
Contributor

@coderXMin coderXMin commented Oct 13, 2023

feat:添加了enableDoubleScale属性(默认为true),true为允许双击缩放,蒙层关闭会有250ms延迟;false为不允许双击缩放,蒙层关闭没有延迟。

解决问题:提供用户双向选择是否开启双击缩放,关闭会导致预留双击时间以致于关闭延迟,解决有些延迟效果不好而且双击缩放需求不大的场景。

package.json Outdated
"husky": "^8.0.1",
"nano-staged": "^0.8.0",
"prettier": "^3.0.0",
"vue": "^3.3.4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么需要在根目录安装 Vue 和格式化 package.json 文件呢

@@ -72,6 +72,7 @@ export const imagePreviewProps = {
closeOnClickOverlay: truthProp,
closeIconPosition: makeStringProp<PopupCloseIconPosition>('top-right'),
teleport: [String, Object] as PropType<TeleportProps['to']>,
enableDoubleScale: Boolean,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文档需要更新

@coderXMin
Copy link
Contributor Author

coderXMin commented Oct 13, 2023 via email

@coderXMin coderXMin changed the title feat: add enableDoubleSclae feat: add enableDoubleScale attribute Oct 13, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 13, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Files Coverage Δ
packages/vant/src/image-preview/ImagePreview.tsx 96.77% <ø> (ø)
packages/vant/src/image-preview/function-call.tsx 85.71% <ø> (ø)
...ckages/vant/src/image-preview/ImagePreviewItem.tsx 82.55% <81.81%> (-0.98%) ⬇️

... and 2 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@chenjiahan
Copy link
Member

哈哈 没事~

@chenjiahan chenjiahan merged commit 1640211 into youzan:main Oct 14, 2023
@HRrong
Copy link

HRrong commented Oct 19, 2023

你好,以组件调用的方式使用 ImagePreview 时,并通过 image 插槽展示图片好像不支持缩放诶

CatsAndMice pushed a commit to CatsAndMice/vant that referenced this pull request Apr 8, 2024
* feat: add enableDoubleSclae

* feat: add enableDoubleScale attribute

* Update package.json

---------

Co-authored-by: neverland <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants