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(image-preview): export onLoad and style for image slot #12740

Merged
merged 2 commits into from Mar 31, 2024

Conversation

chouchouji
Copy link
Contributor

close #12656

@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.84%. Comparing base (f53e134) to head (e222afd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12740      +/-   ##
==========================================
+ Coverage   89.81%   89.84%   +0.02%     
==========================================
  Files         257      257              
  Lines        6835     6835              
  Branches     1660     1660              
==========================================
+ Hits         6139     6141       +2     
  Misses        369      369              
+ Partials      327      325       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

packages/vant/src/image-preview/ImagePreviewItem.tsx Outdated Show resolved Hide resolved
@@ -302,7 +302,7 @@ imagePreviewRef.value?.swipeTo(1);
| --- | --- | --- |
| index | Custom index | _{ index: index of current image }_ |
| cover | Custom content that covers the image preview | - |
| image | Custom image content | _{ src: current image src }_ |
| image | Custom image content | _{ src: current image src, onLoad: load image, style: current image style }_ |
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can add an example to tell user when should they use the style and onLoad

Copy link
Contributor Author

Choose a reason for hiding this comment

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

get

Copy link
Member

Choose a reason for hiding this comment

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

I will merge this PR first, and feel free to open another PR for the example~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I've been feeling a bit unwell lately. It would be great if anyone is willing to complete this task.

Copy link
Member

Choose a reason for hiding this comment

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

Take care of yourself ❤️

The documentation has been added: #12751

@chenjiahan chenjiahan merged commit 3329c3b into youzan:main Mar 31, 2024
3 checks passed
@chouchouji chouchouji deleted the feat-image-preview branch March 31, 2024 09:42
bluesky335 pushed a commit to bluesky335/vant that referenced this pull request Apr 1, 2024
CatsAndMice pushed a commit to CatsAndMice/vant that referenced this pull request Apr 8, 2024
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.

[Feature Request] ImagePreview image slot 也支持长图适应
3 participants