One UI

OneTag

OneTag 支持 neutral、primary、success、warning、error 五种状态与三种尺寸。

已发布默认待检查
查看代码收起代码
import { OneTag } from '@geektech/one';

new OneTag({ variant: 'success', closable: true, children: ['已发布'] });

尺寸与关闭

closable 会显示原生关闭按钮;关闭后发出 close 事件并保留隐藏锚点。

API

OneTag 属性与事件
名称签名说明
variantvariant?: OneDataDisplayVariantneutral、primary、success、warning 或 error。
sizesize?: OneComponentSizesm、md 或 lg,默认 md。
closableclosable?: boolean显示可访问的关闭按钮。
childrenchildren?: Array<VNode | string>标签内容。
close() => void用户关闭标签时发出一次。