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

[comp: avatar] add avatar component #55

Closed
1 task
unknownzjc opened this issue Dec 21, 2020 · 0 comments · Fixed by #371
Closed
1 task

[comp: avatar] add avatar component #55

unknownzjc opened this issue Dec 21, 2020 · 0 comments · Fixed by #371
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@unknownzjc
Copy link
Contributor

unknownzjc commented Dec 21, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

用来代表用户或事物,支持图片、图标或字符展示。

What does the proposed API look like?

ix-avatar

AvatarProps

名称 说明 类型 默认值 全局配置 备注
alt 图像无法显示时的替代文本 string - - -
gap 字符类型距离左右两侧边界单位像素 number 4 -
icon 设置自定义图标 string | VNode | #icon user 如果设置了 src, 则作为图片加载失败的 fallback 行为
shape 设置头像的形状 'circle' | 'square' 'circle' -
size 设置头像的大小 'large' | 'medium' | 'small' | number | Record<BreakpointKey, number> 'medium' -
src 图片类头像的资源地址 string - - -
srcSet 设置图片类头像响应式资源地址 string - - -
onError 图片加载失败的事件 () => unknown - - 返回 false 会关闭组件默认的 fallback 行为

AvatarSlots

名称 说明 参数类型 备注
default 图片加载失败的 fallback 行为 - 优先级高于 icon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants