头像文字或源为空文本时fallback
This commit is contained in:
@@ -12,9 +12,9 @@ export default function Avatar({
|
|||||||
avatarRef,
|
avatarRef,
|
||||||
...props
|
...props
|
||||||
}: Args) {
|
}: Args) {
|
||||||
if (src != null)
|
if (src != null && src != '')
|
||||||
return <mdui-avatar ref={avatarRef} {...props} src={src} />
|
return <mdui-avatar ref={avatarRef} {...props} src={src} />
|
||||||
else if (text != null)
|
else if (text != null && text != '')
|
||||||
return <mdui-avatar ref={avatarRef} {...props}>
|
return <mdui-avatar ref={avatarRef} {...props}>
|
||||||
{
|
{
|
||||||
text.substring(0, 1)
|
text.substring(0, 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user