Skip to content

pantoken / packages/core/src / getIconSvgs

函数: getIconSvgs()

getIconSvgs(tokens): Map<string, string>

Beta

将每个图标令牌映射到其解码后的 SVG(键为不带 --instui-icon- 前缀的名称)。

参数

tokens

只读 Token[]

返回值

Map<string, string>

示例

ts
import { buildTokens } from "@pantoken/core/build";
import { getIconSvgs } from "@pantoken/core";

const svgs = getIconSvgs(buildTokens());
svgs.get("arrow-left"); // → inline SVG markup for the arrow-left glyph (non-icon tokens skipped)