@fiscozen/navlink

中文文档
2.0.5发布于 2026/09/07ISCES Module近 30 天下载 4051

Design System Navlink Component

原始使用文档
文档目录3 节
  1. Notes
  2. Migration to @fiscozen/action
  3. Prop mapping

@fiscozen/navlink

⚠️ Deprecated for external use — internal-only until consumers migrate.

New code must use @fiscozen/action (FzAction) instead.

This package stays published on npm and remains buildable because it is still consumed internally by @fiscozen/actionlist and @fiscozen/navlist (both of which are themselves deprecated). It cannot be removed until those consumers migrate to @fiscozen/action. No new features will be developed and no bug fixes will be backported.

Notes

  • RouterNavlink wraps Navlink and passes all the props to the Navlink inside

Migration to @fiscozen/action

This package exports FzNavlink (button-like) and FzRouterNavlink (router-link wrapper). Both map to FzAction with variant="textLeft", distinguished by the type prop:

<!-- Before: FzNavlink (button) -->
<FzNavlink :iconName="iconName" :iconVariant="iconVariant" :disabled="disabled" @click="onClick">
  {{ label }}
</FzNavlink>

<!-- After: FzAction with type="action" -->
<FzAction
  type="action"
  variant="textLeft"
  :label="label"
  :iconLeftName="iconName"
  :iconLeftVariant="iconVariant"
  :disabled="disabled"
  @click="onClick"
/>
<!-- Before: FzRouterNavlink (vue-router link) -->
<FzRouterNavlink :meta="{ name: 'home' }" :iconName="iconName" :disabled="disabled">
  {{ label }}
</FzRouterNavlink>

<!-- After: FzAction with type="link" -->
<FzAction
  type="link"
  variant="textLeft"
  :label="label"
  :iconLeftName="iconName"
  :to="{ name: 'home' }"
  :disabled="disabled"
/>

Prop mapping

@fiscozen/navlink@fiscozen/actionNotes
iconNameiconLeftNameDefault rendering is left of the label. For an icon-only layout pass variant="onlyIcon" and use iconName instead.
iconVarianticonLeftVariantSame as above for onlyIcon.
iconSize—FzAction derives size from environment and variant; no direct equivalent.
labellabelIdentical.
disableddisabledIdentical. Also supports readonly (new).
meta (on FzRouterNavlink)toPass the same vue-router location object.
Default slotDefault slot (or label)Identical.
Native clickclick, plus keydownFzAction emits keydown for keyboard activation too.

FzAction adds props not available here: subLabel, text truncation, environment (backoffice/frontoffice), role, ariaSelected, and the textCenter / onlyIcon variants.

版本与发布记录

@fiscozen/navlink 共发布 14 个版本,首次发布于 2024/05/13;过去 12 个月发布了 8 个版本。

版本发布日期距今
2.0.5latest2026/09/072 个月前
2.0.42026/07/173 个月前
2.0.32026/06/154 个月前
2.0.22026/04/306 个月前
2.0.12026/04/097 个月前
2.0.02026/03/038 个月前

其他发布通道:beta → 0.1.4-beta.1。

关于 @fiscozen/navlink 的常见问题

@fiscozen/navlink 是什么?

Design System Navlink Component

如何安装 @fiscozen/navlink?

在项目目录运行 npm install @fiscozen/navlink,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:tailwindcss(^3.4.1)、vue(^3.4.13)、vue-router(^4.3.0)、@fiscozen/icons(^1.0.8)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@fiscozen/navlink 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/fiscozen__navlink 是否存在。

@fiscozen/navlink 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@fiscozen/navlink 可以商用吗?

@fiscozen/navlink 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fiscozen/navlink 的下载量有多少?

根据 npm 官方下载统计,@fiscozen/navlink 在 2026/10/15 – 2026/11/13 这 30 天内被下载 4,051 次,日均约 135 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fiscozen/navlink 还在维护吗?

最新版本 2.0.5 发布于 2026/09/07(2 个月前);至今共发布 14 个版本,其中过去 12 个月发布了 8 个;首次发布于 2024/05/13。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。