🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

@tntx/text-avatar-react

Package Overview
Dependencies
Maintainers
0
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tntx/text-avatar-react

TNT 文字头像组件

latest
Source
npmnpm
Version
2.0.3
Version published
Maintainers
0
Created
Source

TNT 文字头像组件

安装

npm i @tntx/text-avatar-react --save

使用

import React from "react";
import { message } from "antd";
import TextAvatar from "@tntx/text-avatar-react";

export default (props) => {
  const user = {
    id: 10,
    account: "xiaoming",
    empStatus: 1,
    nickname: "王小明",
  };

  const cardConfig = [
    {
      label: "部门",
      value: "企业技术部-PaaS-UED",
    },
    {
      label: "邮箱",
      value: "xiaoming@qq.com",
    },
  ];

  return (
    <TextAvatar
      {...user}
      cardConfig={cardConfig}
      onClick={() => {
        message.info("跳转链接");
      }}
    />
  );
};

API

组件 API

参数数据类型是否必填默认值备注
nicknameString-用户昵称
accountString-用户账号,用来判断使用颜色
empStatusnumber1用户状态,1 是正常状态,2 则为灰色
showPopoverbooleantrue是否显示 popover 浮层
sizenumber32头像大小(宽高)
linearGradientbooleanfalse是否渐变
randomColorbooleantrue是否随机颜色,如果不随机,则为固定蓝色
onClickfunction-卡片内的头像点击
themeStringdefault卡片内的主题,default、plant
sameAsChildrenbooleantrue卡片内的头像是否和 children 一样

浮层相关 API

参数数据类型是否必填默认值备注
triggerStringhover浮层详情显示方式,同 Popover
placementStringrightTop浮层详情显示位置,同 Popover
cardConfigArray[]卡片内的详情配置
onClickfunction-卡片内的头像点击

Keywords

tnt

FAQs

Package last updated on 23 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts