New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@doraemon-ui/miniprogram.avatar

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@doraemon-ui/miniprogram.avatar

miniprogram avatar component for doraemon-ui

alpha
latest
npmnpm
Version
0.0.1-alpha.1
Version published
Maintainers
2
Created
Source

Avatar 头像

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

安装

我们推荐使用 npmyarn 的方式进行开发,不仅可在开发环境轻松调试,也可放心地在生产环境打包部署使用,享受整个生态圈和工具链带来的诸多好处。

npm install --save @doraemon-ui/miniprogram.avatar
# or
yarn add @doraemon-ui/miniprogram.avatar

如果你的网络环境不佳,推荐使用 cnpm

使用指南

在 page.json 中引入组件

json

示例代码

在开发者工具中预览效果

WXML

wxml

JAVASCRIPT

js

WXSS

wxss

API

Avatar props

参数类型描述默认值
prefixClsstring自定义类名前缀dora-avatar
shape'circle' | 'square'头像形状circle
size'small' | 'default' | 'large'头像尺寸default
srcstring头像图片地址,优先级高于插槽文字-
bodyStylestring | Partial<CSSStyleDeclaration>自定义外层容器样式,最终会转换为内联样式-
scaleboolean当为文字头像且内容过长时,是否自动缩放文字以适应容器宽度false

Avatar slot

名称描述
-自定义内容

Avatar externalClasses

名称描述
dora-class根节点样式类

CSS Variables

属性描述默认值全局变量
--container-size默认头像尺寸40px-
--container-size-sm小号头像尺寸32px-
--container-size-lg大号头像尺寸48px-
--font-size默认文字字号14px-
--font-size-sm小号文字字号12px-
--font-size-lg大号文字字号16px-
--square-border-radius矩形头像圆角大小var(--dora-border-radius, 8px)--dora-border-radius

Keywords

doraemon-ui

FAQs

Package last updated on 21 Feb 2026

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