-
Notifications
You must be signed in to change notification settings - Fork 482
perf: refine the fallback of the avatar component #649
Conversation
Signed-off-by: Ryan Wang <i@ryanc.cc>
@ruibaby is attempting to deploy a commit to the halo-dev Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's cool!
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JohnNiang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
#### What type of PR is this? /kind improvement /milestone 2.0 #### What this PR does / why we need it: 优化 Avatar 组件在图片加载失败的状态,以及添加加载状态的动画。目前的策略为,如果图片加载异常,那么会取 `alt` 属性生成占位样式。如果没有设置 `alt`,会显示失败的图标。 #### Screenshots: <img width="421" alt="image" src="https://user-images.githubusercontent.com/21301288/196194978-229cf58d-19e1-4492-b77a-8b1a6b41e3a0.png"> #### Special notes for your reviewer: /cc @halo-dev/sig-halo-console 测试方式: 1. 需要 `pnpm build:packages` 2. 测试修改个人资料的头像,观测不同效果。 3. 访问 https://halo-admin-ui-git-fork-ruibaby-perf-avatar-fallback-halo-dev.vercel.app/story/src-components-avatar-avatar-story-vue?variantId=_default 测试不同参数的效果。 #### Does this PR introduce a user-facing change? ```release-note 优化 Avatar 组件在图片加载失败的状态 ```
What type of PR is this?
/kind improvement
/milestone 2.0
What this PR does / why we need it:
优化 Avatar 组件在图片加载失败的状态,以及添加加载状态的动画。目前的策略为,如果图片加载异常,那么会取
alt
属性生成占位样式。如果没有设置alt
,会显示失败的图标。Screenshots:
Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:
pnpm build:packages
Does this PR introduce a user-facing change?