@abdt/avatars 中文文档教程

发布于 3年前 浏览 22 更新于 3年前

A collection of avatars by ABDT

Размер

import React from 'react'

import { Dolphin } from '@abdt/avatars';

const DolphinIcon = () => <Dolphin />

Вариация

import React from 'react'

import DolphinSVG from '@abdt/avatars/Dolphin.svg';

const DolphinIcon = () => <img src={DolphinSVG} alt="" />;

Использование сgenerateAvatarFromString

import React from 'react'

import * as avatarComponents from '@abdt/avatars';

import generateAvatarFromString from '@abdt/avatars/dist/esm/generateAvatarFromString';

const AvatarUsername = avatarComponents[generateAvatarFromString("Username", avatarComponents)];

<AvatarUsername />

A collection of avatars by ABDT

Размер

import React from 'react'

import { Dolphin } from '@abdt/avatars';

const DolphinIcon = () => <Dolphin />

Вариация

import React from 'react'

import DolphinSVG from '@abdt/avatars/Dolphin.svg';

const DolphinIcon = () => <img src={DolphinSVG} alt="" />;

Использование с generateAvatarFromString

import React from 'react'

import * as avatarComponents from '@abdt/avatars';

import generateAvatarFromString from '@abdt/avatars/dist/esm/generateAvatarFromString';

const AvatarUsername = avatarComponents[generateAvatarFromString("Username", avatarComponents)];

<AvatarUsername />
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文