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): add can-preview & on-load prop and add loading & errorbox slot #1714

Merged
merged 10 commits into from
Dec 2, 2021
Merged

Conversation

2277419213
Copy link
Contributor

@2277419213 2277419213 commented Dec 1, 2021

close #1647

@vercel
Copy link

vercel bot commented Dec 1, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tusimple/naive-ui/5nuAMd1mJSErsb5waTBBDeiUdEsB
✅ Preview: https://naive-ui-git-fork-2277419213-main-tusimple.vercel.app

@XieZongChen XieZongChen changed the title feat(image): add can-preview & on-load prop and add loading & errorbox slot ,closes [#1647](https://github.com/TuSimple/naive-ui/issues/1647). feat(image): add can-preview & on-load prop and add loading & errorbox slot Dec 1, 2021
@@ -20,10 +22,19 @@ group
| img-props | `object` | `undefined` | The props of the img element inside the component. |
| object-fit | `'fill' \| 'contain' \| 'cover' \| 'none' \| 'scale-down'` | `fill` | Object-fit type of the image in the container. |
| preview-src | `string` | `undefined` | Source of preview image. |
| can-preview | `boolean` | `true` | Whether clicking image preview is allowed. |
Copy link
Collaborator

Choose a reason for hiding this comment

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

API 措辞不太好, 叫 previewed ? 或者 has-preview ? @07akioni

Copy link
Collaborator

@07akioni 07akioni Dec 2, 2021

Choose a reason for hiding this comment

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

preview-disabled

src/image/demos/enUS/index.demo-entry.md Show resolved Hide resolved
@@ -0,0 +1,71 @@
# 加载图片

仅仅只是演示加载效果,在图片加载的时候组件会自动显示加载的效果,`不推荐`直接修改 showLoadIng 属性,除非你很明确知道你在做什么!
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
仅仅只是演示加载效果,在图片加载的时候组件会自动显示加载的效果,`不推荐`直接修改 showLoadIng 属性,除非你很明确知道你在做什么!
仅仅只是演示加载效果,在图片加载的时候组件会自动显示加载的效果,**不推荐** 直接修改 showLoadIng 属性,除非你很明确知道你在做什么!

`` 仅在 code 或 API 下使用,英文文档同

@codecov
Copy link

codecov bot commented Dec 1, 2021

Codecov Report

Merging #1714 (f4b7762) into main (7350ec7) will increase coverage by 0.03%.
The diff coverage is 85.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1714      +/-   ##
==========================================
+ Coverage   64.76%   64.79%   +0.03%     
==========================================
  Files         886      886              
  Lines       17217    17249      +32     
  Branches     4075     4086      +11     
==========================================
+ Hits        11150    11176      +26     
- Misses       5300     5302       +2     
- Partials      767      771       +4     
Impacted Files Coverage Δ
src/image/src/styles/index.cssr.ts 100.00% <ø> (ø)
src/image/styles/dark.ts 50.00% <ø> (ø)
src/image/styles/light.ts 100.00% <ø> (ø)
src/switch/src/Switch.tsx 67.12% <0.00%> (-3.90%) ⬇️
src/switch/src/styles/index.cssr.ts 100.00% <ø> (ø)
src/image/src/Image.tsx 95.16% <94.28%> (-1.99%) ⬇️
src/image/src/icons.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7350ec7...f4b7762. Read the comment docs.

@2277419213
Copy link
Contributor Author

n-switch add activeColor & inactiveColor & activeButtonColor & inactiveButtonColor prop, closes #1718

Comment on lines +33 to +36
| activeColor | `string` | `undefined` | Background of checked state. |
| inactiveColor | `string` | `undefined` | Background of unchecked state. |
| activeButtonColor | `string` | `undefined` | Button background of checked state. |
| inactiveButtonColor | `string` | `undefined` | Button background of unchecked state. |
Copy link
Collaborator

Choose a reason for hiding this comment

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

文档里都用 kebab case

Copy link
Collaborator

Choose a reason for hiding this comment

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

还有按照字母顺序

@07akioni 07akioni merged commit 3884845 into tusen-ai:main Dec 2, 2021
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.

否能增加一个Prop控制Image组件预览开关
3 participants