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)