Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

perf: refine the fallback of the avatar component #649

Merged
merged 2 commits into from
Oct 17, 2022

Conversation

ruibaby
Copy link
Member

@ruibaby ruibaby commented Oct 17, 2022

What type of PR is this?

/kind improvement
/milestone 2.0

What this PR does / why we need it:

优化 Avatar 组件在图片加载失败的状态,以及添加加载状态的动画。目前的策略为,如果图片加载异常,那么会取 alt 属性生成占位样式。如果没有设置 alt,会显示失败的图标。

Screenshots:

image

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?

优化 Avatar 组件在图片加载失败的状态

Signed-off-by: Ryan Wang <i@ryanc.cc>
@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/improvement Categorizes issue or PR as related to a improvement. labels Oct 17, 2022
@f2c-ci-robot f2c-ci-robot bot added this to the 2.0 milestone Oct 17, 2022
@vercel
Copy link

vercel bot commented Oct 17, 2022

@ruibaby is attempting to deploy a commit to the halo-dev Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Oct 17, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
halo-admin-next ✅ Ready (Inspect) Visit Preview Oct 17, 2022 at 2:02PM (UTC)
halo-admin-ui ✅ Ready (Inspect) Visit Preview Oct 17, 2022 at 2:02PM (UTC)

Signed-off-by: Ryan Wang <i@ryanc.cc>
Copy link
Member

@JohnNiang JohnNiang left a 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

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Oct 17, 2022

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 17, 2022
Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2022
@f2c-ci-robot f2c-ci-robot bot merged commit 6d8a2dd into halo-dev:main Oct 17, 2022
@ruibaby ruibaby deleted the perf/avatar-fallback branch October 18, 2022 15:31
JohnNiang pushed a commit to JohnNiang/halo that referenced this pull request Mar 2, 2023
#### 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 组件在图片加载失败的状态
```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/improvement Categorizes issue or PR as related to a improvement. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants