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

fix(ImagePreview): incorrect image slot scaling #12377

Closed
wants to merge 2 commits into from

Conversation

coderXMin
Copy link
Contributor

fix: 修改以组件调用的方式使用 ImagePreview 时,通过 image 插槽展示图片不支持缩放问题。如果自定义内容不是图片标签,则不支持缩放。

@coderXMin coderXMin changed the title Dev fix(ImagePreview): incorrect image slot scaling Oct 20, 2023
@codecov-commenter
Copy link

Codecov Report

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

Files Coverage Δ
...ckages/vant/src/image-preview/ImagePreviewItem.tsx 80.10% <35.71%> (-3.62%) ⬇️

📢 Thoughts on this report? Let us know!.

@chenjiahan
Copy link
Member

判断 slots 里的内容很难做到准确,因为 slots 里可以插入任意内容,组件是没法确定使用者是不是真的需要图片缩放的。

是否可以把 imageStyle.value 作为 slots 的属性传递给使用者,然后由使用者决定是否要使用该样式呢?

@coderXMin
Copy link
Contributor Author

确实是这样的,这个问题得后续再想想吧

@chenjiahan
Copy link
Member

已在 #12740 支持

@chenjiahan chenjiahan closed this Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants