fix: disable link navigation and align breadcrumb actions and date focus
This commit is contained in:
@@ -132,14 +132,14 @@ Link 使用以下 CSS 类:
|
||||
| `target` | `string` | — | 在何处打开链接文档;省略时使用浏览器同窗口默认行为,不输出 target 属性 |
|
||||
| `rel` | `string` | - | 当前文档与链接文档的关系 |
|
||||
| `download` | `boolean \| string` | - | 触发下载而非导航;`true` 渲染 `download`,`false`/未传省略属性 |
|
||||
| `isDisabled` | `boolean` | `false` | 禁用指针与键盘交互;保留可聚焦与 `aria-disabled` |
|
||||
| `isDisabled` | `boolean` | `false` | 禁用激活,移除导航/下载属性;保留 `aria-disabled` 与程序化聚焦 |
|
||||
| `asChild` | `boolean` | `false` | 合并到默认插槽唯一元素,并补充 `role="link"` 与 `tabindex="0"` |
|
||||
| `autoFocus` | `boolean` | - | 挂载后聚焦真实 DOM 根元素(含 asChild) |
|
||||
| `class` | `string` | - | 与默认样式合并的自定义类 |
|
||||
|
||||
默认插槽渲染链接内部内容。作用域插槽提供 `isDisabled`、`isHovered`、`isPressed`、`isFocused`、`isFocusVisible`。`@click` 等 DOM 事件通过 attrs 透传;`isDisabled` 时阻止激活(含 Vue 合并后的监听器数组)。React Aria 的 `onPress` / `PressEvent` 由原生 `click` 适配,不等价。
|
||||
|
||||
`asChild` 适用于 `<a>`、`RouterLink` 等已具备导航能力的元素,以及需要自定义外观的 `span`/`div`:非原生可激活元素会获得 `role="link"`、`tabindex="0"`,Enter 触发一次激活(与点击同一 `click` 路径)。自定义元素上的 `href` 不会由浏览器直接导航,请用 `a` / 路由组件作为 asChild 目标,或在 `@click` 中自行处理跳转。禁用时仍可聚焦以便读出 `aria-disabled`,但不会激活。
|
||||
`asChild` 适用于 `<a>`、`RouterLink` 等已具备导航能力的元素,以及需要自定义外观的 `span`/`div`:非原生可激活元素会获得 `role="link"`、`tabindex="0"`,Enter 触发一次激活(与点击同一 `click` 路径)。自定义元素上的 `href` 不会由浏览器直接导航,请用 `a` / 路由组件作为 asChild 目标,或在 `@click` 中自行处理跳转。禁用时移除根元素的 `href`、`target`、`download`,包括 asChild 子元素自带的对应属性;`tabindex="-1"` 排除 Tab 顺序,仍可通过暴露的 `focus()` 程序化聚焦。重新启用后恢复属性,保留用户处理器和子元素 ref。自定义路由组件应把合并后的属性透传到真实根元素,不应自行覆盖禁用态的导航属性。
|
||||
|
||||
### LinkIcon
|
||||
|
||||
|
||||
Reference in New Issue
Block a user