x-next 1.12.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI_CODING.md +6 -5
- package/AI_USAGE/catalog.md +106 -105
- package/AI_USAGE/components/alert-api.md +48 -0
- package/AI_USAGE/components/alert.md +222 -3
- package/AI_USAGE/components/bar-chart-api.md +177 -0
- package/AI_USAGE/components/bar-chart.md +297 -3
- package/AI_USAGE/components/boxicons.md +147 -0
- package/AI_USAGE/components/button-api.md +144 -0
- package/AI_USAGE/components/button.md +447 -3
- package/AI_USAGE/components/charts.md +81 -0
- package/AI_USAGE/components/checkbox-api.md +145 -0
- package/AI_USAGE/components/checkbox.md +365 -3
- package/AI_USAGE/components/color-picker-api.md +52 -0
- package/AI_USAGE/components/color-picker.md +211 -3
- package/AI_USAGE/components/config-provider-api.md +38 -0
- package/AI_USAGE/components/config-provider.md +250 -3
- package/AI_USAGE/components/date-picker-api.md +1114 -0
- package/AI_USAGE/components/date-picker.md +378 -3
- package/AI_USAGE/components/dialog-api.md +142 -0
- package/AI_USAGE/components/dialog.md +284 -3
- package/AI_USAGE/components/draggable-api.md +146 -0
- package/AI_USAGE/components/draggable.md +259 -0
- package/AI_USAGE/components/drawer-api.md +78 -0
- package/AI_USAGE/components/drawer.md +227 -0
- package/AI_USAGE/components/dropdown-api.md +529 -0
- package/AI_USAGE/components/dropdown.md +392 -3
- package/AI_USAGE/components/empty-api.md +36 -0
- package/AI_USAGE/components/empty.md +227 -3
- package/AI_USAGE/components/finicon.md +88 -0
- package/AI_USAGE/components/form-api.md +524 -0
- package/AI_USAGE/components/form.md +454 -0
- package/AI_USAGE/components/grid-api.md +527 -0
- package/AI_USAGE/components/grid.md +224 -0
- package/AI_USAGE/components/heatmap-api.md +122 -0
- package/AI_USAGE/components/heatmap.md +220 -0
- package/AI_USAGE/components/icon-api.md +4707 -0
- package/AI_USAGE/components/icon.md +257 -0
- package/AI_USAGE/components/image-api.md +440 -0
- package/AI_USAGE/components/image.md +465 -0
- package/AI_USAGE/components/input-api.md +184 -0
- package/AI_USAGE/components/input-number-api.md +66 -0
- package/AI_USAGE/components/input-number.md +294 -0
- package/AI_USAGE/components/input-tag-api.md +114 -0
- package/AI_USAGE/components/input-tag.md +482 -0
- package/AI_USAGE/components/input.md +293 -3
- package/AI_USAGE/components/layout-api.md +147 -0
- package/AI_USAGE/components/layout.md +230 -0
- package/AI_USAGE/components/line-chart-api.md +197 -0
- package/AI_USAGE/components/line-chart.md +279 -3
- package/AI_USAGE/components/link-api.md +42 -0
- package/AI_USAGE/components/link.md +197 -0
- package/AI_USAGE/components/menu-api.md +516 -0
- package/AI_USAGE/components/menu.md +268 -0
- package/AI_USAGE/components/message-api.md +215 -0
- package/AI_USAGE/components/message-box-api.md +108 -0
- package/AI_USAGE/components/message-box.md +268 -3
- package/AI_USAGE/components/message.md +231 -3
- package/AI_USAGE/components/network-api.md +91 -0
- package/AI_USAGE/components/network.md +378 -0
- package/AI_USAGE/components/notification-api.md +236 -0
- package/AI_USAGE/components/notification.md +275 -3
- package/AI_USAGE/components/pagination-api.md +62 -0
- package/AI_USAGE/components/pagination.md +386 -5
- package/AI_USAGE/components/pie-chart-api.md +109 -0
- package/AI_USAGE/components/pie-chart.md +245 -3
- package/AI_USAGE/components/popconfirm-api.md +75 -0
- package/AI_USAGE/components/popconfirm.md +231 -3
- package/AI_USAGE/components/popover-api.md +75 -0
- package/AI_USAGE/components/popover.md +208 -3
- package/AI_USAGE/components/popup-api.md +75 -0
- package/AI_USAGE/components/popup.md +52 -0
- package/AI_USAGE/components/progress-api.md +44 -0
- package/AI_USAGE/components/progress.md +248 -3
- package/AI_USAGE/components/radio-api.md +165 -0
- package/AI_USAGE/components/radio.md +259 -3
- package/AI_USAGE/components/rate-api.md +54 -0
- package/AI_USAGE/components/rate.md +233 -3
- package/AI_USAGE/components/resize-box-api.md +56 -0
- package/AI_USAGE/components/resize-box.md +231 -0
- package/AI_USAGE/components/scrollbar-api.md +77 -0
- package/AI_USAGE/components/scrollbar.md +218 -0
- package/AI_USAGE/components/select-api.md +758 -0
- package/AI_USAGE/components/select.md +640 -3
- package/AI_USAGE/components/skeleton-api.md +85 -0
- package/AI_USAGE/components/skeleton.md +150 -0
- package/AI_USAGE/components/slider-api.md +51 -0
- package/AI_USAGE/components/slider.md +233 -3
- package/AI_USAGE/components/space-api.md +38 -0
- package/AI_USAGE/components/space.md +145 -0
- package/AI_USAGE/components/spin-api.md +43 -0
- package/AI_USAGE/components/spin.md +205 -0
- package/AI_USAGE/components/steps-api.md +111 -0
- package/AI_USAGE/components/steps.md +201 -3
- package/AI_USAGE/components/switch-api.md +58 -0
- package/AI_USAGE/components/switch.md +290 -3
- package/AI_USAGE/components/table-api.md +2919 -0
- package/AI_USAGE/components/table.md +1414 -0
- package/AI_USAGE/components/tabs-api.md +135 -0
- package/AI_USAGE/components/tabs.md +308 -3
- package/AI_USAGE/components/tag-api.md +124 -0
- package/AI_USAGE/components/tag.md +292 -0
- package/AI_USAGE/components/textarea-api.md +55 -0
- package/AI_USAGE/components/textarea.md +326 -3
- package/AI_USAGE/components/time-picker-api.md +137 -0
- package/AI_USAGE/components/time-picker.md +271 -3
- package/AI_USAGE/components/time-range-selector-api.md +44 -0
- package/AI_USAGE/components/time-range-selector.md +355 -0
- package/AI_USAGE/components/timeline-api.md +93 -0
- package/AI_USAGE/components/timeline.md +312 -0
- package/AI_USAGE/components/tooltip-api.md +77 -0
- package/AI_USAGE/components/tooltip.md +182 -0
- package/AI_USAGE/components/trend-chart-api.md +119 -0
- package/AI_USAGE/components/trend-chart.md +335 -0
- package/AI_USAGE/components/trigger-api.md +124 -0
- package/AI_USAGE/components/trigger.md +185 -0
- package/AI_USAGE/components/upload-api.md +200 -0
- package/AI_USAGE/components/upload.md +711 -3
- package/AI_USAGE/components/watermark-api.md +87 -0
- package/AI_USAGE/components/watermark.md +200 -0
- package/AI_USAGE/core.md +1 -1
- package/AI_USAGE/index.md +35 -7
- package/AI_USAGE/recipes/form-on-demand.md +1 -1
- package/AI_USAGE.md +33657 -7
- package/CHANGELOG.md +40 -0
- package/dist/_utils/inherit-component-type.d.ts +11 -0
- package/dist/components/date-picker/index.d.ts +420 -5
- package/dist/components/form-input/index.d.ts +617 -2
- package/dist/components/layout/index.d.ts +689 -1
- package/dist/components/menu/index.d.ts +786 -1
- package/dist/components/network/Network.vue.d.ts +7 -3
- package/dist/components/network/index.d.ts +10 -2
- package/dist/components/network/props.d.ts +5 -0
- package/dist/components/network/utils.d.ts +3 -3
- package/dist/components/pagination/page-item-ellipsis.vue.d.ts +4 -1
- package/dist/components/pagination/page-item-step.vue.d.ts +101 -130
- package/dist/components/pagination/page-item.vue.d.ts +1 -0
- package/dist/components/pagination/page-jumper.vue.d.ts +1 -1
- package/dist/components/pagination/page-options.vue.d.ts +6 -4
- package/dist/components/pagination/utils.d.ts +3 -0
- package/dist/components/time-range-selector/index.d.ts +6 -6
- package/dist/es/_container/resize-observer-v2.js +1 -1
- package/dist/es/_container/resize-observer.js +1 -1
- package/dist/es/_hooks/use-resize-observer.js +1 -1
- package/dist/es/_styles/palette-aliases.js +4 -4
- package/dist/es/_utils/inherit-component-type.js +6 -0
- package/dist/es/_virtual/advancedFormat.js +1 -1
- package/dist/es/_virtual/customParseFormat.js +1 -1
- package/dist/es/_virtual/dayjs.min.js +1 -1
- package/dist/es/_virtual/isBetween.js +1 -1
- package/dist/es/_virtual/quarterOfYear.js +1 -1
- package/dist/es/_virtual/weekOfYear.js +1 -1
- package/dist/es/_virtual/weekYear.js +1 -1
- package/dist/es/_virtual/zh-cn.js +1 -1
- package/dist/es/components/button/Button.js +53 -42
- package/dist/es/components/date-picker/index.js +18 -17
- package/dist/es/components/draggable/useDraggable.js +1 -1
- package/dist/es/components/form/Form.vue2.js +1 -1
- package/dist/es/components/form/FormItem.vue2.js +1 -1
- package/dist/es/components/form-input/index.js +12 -11
- package/dist/es/components/form-input-number/InputNumber.js +1 -1
- package/dist/es/components/form-slider/Slider.vue2.js +1 -1
- package/dist/es/components/form-slider/slider-ticks.vue2.js +1 -1
- package/dist/es/components/form-slider/utils.js +1 -1
- package/dist/es/components/layout/index.js +10 -9
- package/dist/es/components/menu/MenuItem.js +1 -1
- package/dist/es/components/menu/hooks/use-level.js +5 -5
- package/dist/es/components/menu/index.js +13 -10
- package/dist/es/components/menu/overflow-wrap.js +1 -1
- package/dist/es/components/network/Network.vue.js +17 -12
- package/dist/es/components/network/Network.vue2.js +78 -70
- package/dist/es/components/network/utils.js +112 -71
- package/dist/es/components/pagination/Pagination.js +132 -123
- package/dist/es/components/pagination/page-item-ellipsis.vue.js +10 -10
- package/dist/es/components/pagination/page-item-ellipsis.vue2.js +24 -19
- package/dist/es/components/pagination/page-item-step.vue.js +14 -11
- package/dist/es/components/pagination/page-item-step.vue2.js +20 -22
- package/dist/es/components/pagination/page-item.vue.js +10 -9
- package/dist/es/components/pagination/page-item.vue2.js +24 -19
- package/dist/es/components/pagination/page-jumper.vue2.js +23 -23
- package/dist/es/components/pagination/page-options.vue.js +15 -10
- package/dist/es/components/pagination/page-options.vue2.js +21 -17
- package/dist/es/components/pagination/utils.js +4 -2
- package/dist/es/components/progress/circle.vue2.js +1 -1
- package/dist/es/components/progress/line.vue2.js +1 -1
- package/dist/es/components/progress/steps.vue2.js +1 -1
- package/dist/es/components/rate/Rate.js +1 -1
- package/dist/es/components/virtual-list-v2/virtual-list-item.js +1 -1
- package/dist/es/locale/en-US.js +2 -0
- package/dist/es/locale/zh-CN.js +2 -0
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/dayjs.min.js +1 -1
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/locale/zh-cn.js +1 -1
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/advancedFormat.js +1 -1
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/customParseFormat.js +1 -1
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/isBetween.js +1 -1
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/quarterOfYear.js +1 -1
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/weekOfYear.js +1 -1
- package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/dayjs@1.11.21/node_modules/dayjs/plugin/weekYear.js +1 -1
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/locale/interface.d.ts +3 -0
- package/dist/style/base.css +1 -1
- package/dist/style/button.css +1 -1
- package/dist/style/form-select.css +1 -1
- package/dist/style/network.css +1 -1
- package/dist/style/pagination.css +1 -1
- package/dist/style/table.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +10 -5
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/index.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/is.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/locale/en-US.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/array.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/base.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/boolean.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/custom.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/number.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/object.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/string.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/rules/type.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/util.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/compute-scroll-into-view@3.1.1/node_modules/compute-scroll-into-view/dist/index.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/number-precision@1.6.0/node_modules/number-precision/build/index.es.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/scroll-into-view-if-needed@3.1.0/node_modules/scroll-into-view-if-needed/dist/index.js +0 -0
- /package/dist/es/{Users/xuyu/Code/x-next/node_modules → node_modules}/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.js +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
|
|
2
|
+
# Tabs 完整公开 API
|
|
3
|
+
|
|
4
|
+
适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
|
|
5
|
+
|
|
6
|
+
从同版本构建的公开声明、运行时 props/emits 和显式 expose 生成。运行时导入始终使用 `x-next`,声明路径仅作定位。插槽类型未细化时,具体槽名与作用域见本地用法示例。
|
|
7
|
+
|
|
8
|
+
## TabPane API
|
|
9
|
+
|
|
10
|
+
公开声明:`dist/components/tabs/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
|
|
11
|
+
|
|
12
|
+
### Props
|
|
13
|
+
|
|
14
|
+
| 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
|
|
15
|
+
| --- | --- | --- | --- | --- |
|
|
16
|
+
| title | 标签标题 | undefined | string | 否 | 未声明 |
|
|
17
|
+
| disabled | 是否禁用 | undefined | false | true | 否 | false |
|
|
18
|
+
| closable | 是否允许关闭 | undefined | false | true | 否 | true |
|
|
19
|
+
| destroyOnHide | 隐藏时是否销毁内容,优先级高于 Tabs 的全局设置 | undefined | false | true | 否 | false |
|
|
20
|
+
|
|
21
|
+
### Events
|
|
22
|
+
|
|
23
|
+
未声明组件 emits;原生事件与包装透传按本页用法核实。
|
|
24
|
+
|
|
25
|
+
### Slots
|
|
26
|
+
|
|
27
|
+
公开类型未逐项声明插槽;本页场景说明列出实际使用的插槽,不将任意插槽视为已支持。
|
|
28
|
+
|
|
29
|
+
### 实例方法
|
|
30
|
+
|
|
31
|
+
没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
|
|
32
|
+
|
|
33
|
+
### 关联类型定义
|
|
34
|
+
|
|
35
|
+
以下摘自本组件族声明,供查阅嵌套配置;运行时和值类型均以根入口可导出项为准。
|
|
36
|
+
|
|
37
|
+
```typescript-reference
|
|
38
|
+
type TabsPosition = 'left' | 'right' | 'top' | 'bottom';
|
|
39
|
+
|
|
40
|
+
type TabsType = 'line' | 'card' | 'card-gutter' | 'text' | 'rounded' | 'capsule';
|
|
41
|
+
|
|
42
|
+
interface TabData {
|
|
43
|
+
key: string | number;
|
|
44
|
+
title?: string;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
closable?: boolean;
|
|
47
|
+
slots: Slots;
|
|
48
|
+
/** tab 自身 id,供 panel 的 aria-labelledby 引用(TabPane 按实例 uid 生成) */
|
|
49
|
+
tabId?: string;
|
|
50
|
+
/** 对应 panel 的 id,供 tab 的 aria-controls 引用 */
|
|
51
|
+
panelId?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type TabTriggerEvent = 'click' | 'hover';
|
|
55
|
+
|
|
56
|
+
type ScrollPosition = 'start' | 'end' | 'center' | 'auto' | number;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## Tabs API
|
|
61
|
+
|
|
62
|
+
公开声明:`dist/components/tabs/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
|
|
63
|
+
|
|
64
|
+
### Props
|
|
65
|
+
|
|
66
|
+
| 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
|
|
67
|
+
| --- | --- | --- | --- | --- |
|
|
68
|
+
| activeKey | 当前激活标签 key | undefined | string | number | 否 | undefined |
|
|
69
|
+
| defaultActiveKey | 默认激活标签 key | undefined | string | number | 否 | undefined |
|
|
70
|
+
| position | 标签位置 | undefined | "top" | "bottom" | "right" | "left" | 否 | "top" |
|
|
71
|
+
| size | 标签尺寸 | undefined | "mini" | "small" | "medium" | "large" | 否 | 未声明 |
|
|
72
|
+
| type | 标签类型 | undefined | "text" | "line" | "card" | "card-gutter" | "rounded" | "capsule" | 否 | "line" |
|
|
73
|
+
| direction | 方向,设置为 vertical 时等同左侧标签栏 | undefined | "horizontal" | "vertical" | 否 | "horizontal" |
|
|
74
|
+
| editable | 是否开启可编辑模式,仅 line、card、card-gutter 显示关闭/新增入口 | undefined | false | true | 否 | false |
|
|
75
|
+
| showAddButton | 是否显示新增按钮 | undefined | false | true | 否 | false |
|
|
76
|
+
| destroyOnHide | 隐藏时是否销毁内容 | undefined | false | true | 否 | false |
|
|
77
|
+
| lazyLoad | 是否首次展示时再挂载内容 | undefined | false | true | 否 | false |
|
|
78
|
+
| justify | 是否撑满容器 | undefined | false | true | 否 | false |
|
|
79
|
+
| animation | 是否开启内容切换动画 | undefined | false | true | 否 | false |
|
|
80
|
+
| headerPadding | 线条和文本类型下是否保留头部水平边距 | undefined | false | true | 否 | true |
|
|
81
|
+
| autoSwitch | 新增标签后是否自动切到最后一个标签 | undefined | false | true | 否 | false |
|
|
82
|
+
| hideContent | 是否隐藏内容区域 | undefined | false | true | 否 | false |
|
|
83
|
+
| trigger | 触发方式 | undefined | "click" | "hover" | 否 | "click" |
|
|
84
|
+
| scrollPosition | 激活标签滚动位置 | undefined | number | "center" | "start" | "end" | "auto" | 否 | "auto" |
|
|
85
|
+
|
|
86
|
+
### Events
|
|
87
|
+
|
|
88
|
+
| 事件 | 用途 | 监听器签名(即事件参数) |
|
|
89
|
+
| --- | --- | --- |
|
|
90
|
+
| update:activeKey | 激活标签变化时触发 | undefined | (key: string | number) => any |
|
|
91
|
+
| change | 激活标签变化时触发 | undefined | (key: string | number) => any |
|
|
92
|
+
| tabClick | 点击或触发标签时触发 | undefined | (key: string | number, ev: Event) => any |
|
|
93
|
+
| add | 点击新增按钮时触发 | undefined | (ev: Event) => any |
|
|
94
|
+
| delete | 点击删除按钮时触发 | undefined | (key: string | number, ev: Event) => any |
|
|
95
|
+
|
|
96
|
+
### Slots
|
|
97
|
+
|
|
98
|
+
| 名称 | 用途 | 公开类型 |
|
|
99
|
+
| --- | --- | --- |
|
|
100
|
+
| 组件 | 插槽名 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
101
|
+
| Tabs | default | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
102
|
+
| TabPane | default | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
103
|
+
|
|
104
|
+
### 实例方法
|
|
105
|
+
|
|
106
|
+
没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
|
|
107
|
+
|
|
108
|
+
### 关联类型定义
|
|
109
|
+
|
|
110
|
+
以下摘自本组件族声明,供查阅嵌套配置;运行时和值类型均以根入口可导出项为准。
|
|
111
|
+
|
|
112
|
+
```typescript-reference
|
|
113
|
+
type TabsPosition = 'left' | 'right' | 'top' | 'bottom';
|
|
114
|
+
|
|
115
|
+
type TabsType = 'line' | 'card' | 'card-gutter' | 'text' | 'rounded' | 'capsule';
|
|
116
|
+
|
|
117
|
+
interface TabData {
|
|
118
|
+
key: string | number;
|
|
119
|
+
title?: string;
|
|
120
|
+
disabled?: boolean;
|
|
121
|
+
closable?: boolean;
|
|
122
|
+
slots: Slots;
|
|
123
|
+
/** tab 自身 id,供 panel 的 aria-labelledby 引用(TabPane 按实例 uid 生成) */
|
|
124
|
+
tabId?: string;
|
|
125
|
+
/** 对应 panel 的 id,供 tab 的 aria-controls 引用 */
|
|
126
|
+
panelId?: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
type TabTriggerEvent = 'click' | 'hover';
|
|
130
|
+
|
|
131
|
+
type ScrollPosition = 'start' | 'end' | 'center' | 'auto' | number;
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
返回 [Tabs 用法](./tabs.md)。
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
|
|
2
2
|
# Tabs AI 使用
|
|
3
3
|
|
|
4
|
-
适用版本:x-next@1.
|
|
4
|
+
适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
|
|
5
5
|
|
|
6
|
-
先读 [通用接入](../core.md)。公开导出:`Tabs
|
|
6
|
+
先读 [通用接入](../core.md)。公开导出:`TabPane, Tabs`;主要模型:v-model:active-key。完整 Props、Events、Slots、实例方法与服务签名见 [本地 API](./tabs-api.md),包含本组件族全部子组件和别名。
|
|
7
7
|
|
|
8
8
|
按需样式:`x-next/style/tabs`(包含 base.css、tabs.css)。代码块未单独引样式时在应用入口加载全量样式,或按实际所有组件加载 JS 入口;不要仅因复制一个组件页就漏掉其中的 Button 等组合依赖。
|
|
9
9
|
|
|
10
|
+
## 已核验行为与示例
|
|
11
|
+
|
|
10
12
|
[组件文档与 live demo](https://x-next.yjmf.com/components/tabs)。使用 `v-model:active-key`,类型为 `string | number`;TabPane 用 Vue 的 `key` 标识页签,键类型须与模型一致。默认 `type='line'`、`position='top'`、`trigger='click'`、`lazyLoad=false`、`destroyOnHide=false`。
|
|
11
13
|
|
|
12
14
|
`change(key)` 返回键值,`tab-click(key, event)` 还返回 `Event`。禁用配置放在 TabPane;TabPane 默认插槽放正文,`title` 插槽自定义标题,Tabs 的 `extra` 放额外内容。可编辑模式的 `add` / `delete` 事件需要业务维护页签数据。
|
|
@@ -30,4 +32,307 @@ function changed(key: string | number) { feedback.value = `当前页签:${key}
|
|
|
30
32
|
</template>
|
|
31
33
|
```
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
## 场景用法
|
|
36
|
+
|
|
37
|
+
以下示例从本地 `src/docs/components/tabs.md` 显式导入到独立 AI 源,补齐局部注册、状态和样式后进行严格模板检查。上方已核验行为优先;原始 prop 默认值、包装透传和示例业务适配分别查 [完整 API](./tabs-api.md) 与场景说明。类型通过不代表所有散文和交互已验证。
|
|
38
|
+
|
|
39
|
+
### 用途与选型
|
|
40
|
+
|
|
41
|
+
用于同层级内容分组切换。
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### 何时使用
|
|
45
|
+
|
|
46
|
+
- 页面中有多个平级视图,需要在同一区域切换展示。
|
|
47
|
+
- 内容之间相互独立,切换时希望保留或按需销毁面板状态。
|
|
48
|
+
- 需要可关闭、可新增或横向滚动的页签导航。
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### 基础用法
|
|
52
|
+
|
|
53
|
+
```vue
|
|
54
|
+
<script setup lang="ts">
|
|
55
|
+
import 'x-next/style.css';
|
|
56
|
+
import { Tabs, TabPane } from 'x-next';
|
|
57
|
+
import { ref } from 'vue';
|
|
58
|
+
|
|
59
|
+
const activeKey = ref('overview');
|
|
60
|
+
</script>
|
|
61
|
+
<template>
|
|
62
|
+
<Tabs v-model:active-key="activeKey">
|
|
63
|
+
<TabPane key="overview" title="概览">组件能力总览</TabPane>
|
|
64
|
+
<TabPane key="api" title="API">属性、事件与插槽</TabPane>
|
|
65
|
+
<TabPane key="guide" title="指南">使用建议</TabPane>
|
|
66
|
+
</Tabs>
|
|
67
|
+
</template>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 受控值和事件
|
|
71
|
+
|
|
72
|
+
```vue
|
|
73
|
+
<script setup lang="ts">
|
|
74
|
+
import 'x-next/style.css';
|
|
75
|
+
import { Tabs, TabPane } from 'x-next';
|
|
76
|
+
import { ref } from 'vue';
|
|
77
|
+
|
|
78
|
+
const activeKey = ref('task');
|
|
79
|
+
const handleChange = (key: string | number) => {
|
|
80
|
+
console.log('change', key);
|
|
81
|
+
};
|
|
82
|
+
const handleTabClick = (key: string | number) => {
|
|
83
|
+
console.log('tab-click', key);
|
|
84
|
+
};
|
|
85
|
+
</script>
|
|
86
|
+
<template>
|
|
87
|
+
<Tabs v-model:active-key="activeKey" @change="handleChange" @tab-click="handleTabClick">
|
|
88
|
+
<TabPane key="task" title="任务">任务面板</TabPane>
|
|
89
|
+
<TabPane key="member" title="成员">成员面板</TabPane>
|
|
90
|
+
<TabPane key="disabled" title="禁用" disabled>禁用面板</TabPane>
|
|
91
|
+
</Tabs>
|
|
92
|
+
</template>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 类型和尺寸
|
|
96
|
+
|
|
97
|
+
```vue
|
|
98
|
+
<script setup lang="ts">
|
|
99
|
+
import 'x-next/style.css';
|
|
100
|
+
import { RadioGroup, Tabs, TabPane } from 'x-next';
|
|
101
|
+
import { ref } from 'vue';
|
|
102
|
+
|
|
103
|
+
const activeKey = ref('line');
|
|
104
|
+
const type = ref<'line' | 'card' | 'card-gutter' | 'text' | 'rounded' | 'capsule'>('card-gutter');
|
|
105
|
+
const size = ref<'mini' | 'small' | 'medium' | 'large'>('large');
|
|
106
|
+
const typeOptions = [
|
|
107
|
+
{ label: 'Line', value: 'line' },
|
|
108
|
+
{ label: 'Card', value: 'card' },
|
|
109
|
+
{ label: 'Card Gutter', value: 'card-gutter' },
|
|
110
|
+
{ label: 'Text', value: 'text' },
|
|
111
|
+
{ label: 'Rounded', value: 'rounded' },
|
|
112
|
+
{ label: 'Capsule', value: 'capsule' },
|
|
113
|
+
];
|
|
114
|
+
const sizeOptions = [
|
|
115
|
+
{ label: 'Mini', value: 'mini' },
|
|
116
|
+
{ label: 'Small', value: 'small' },
|
|
117
|
+
{ label: 'Medium', value: 'medium' },
|
|
118
|
+
{ label: 'Large', value: 'large' },
|
|
119
|
+
];
|
|
120
|
+
</script>
|
|
121
|
+
<template>
|
|
122
|
+
<RadioGroup v-model="type" type="button" :options="typeOptions" />
|
|
123
|
+
<RadioGroup v-model="size" type="button" :options="sizeOptions" />
|
|
124
|
+
<Tabs v-model:active-key="activeKey" :type="type" :size="size">
|
|
125
|
+
<TabPane key="line" title="线条">线条样式</TabPane>
|
|
126
|
+
<TabPane key="card" title="卡片">卡片样式</TabPane>
|
|
127
|
+
<TabPane key="capsule" title="胶囊">胶囊样式</TabPane>
|
|
128
|
+
</Tabs>
|
|
129
|
+
</template>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### 标签位置
|
|
133
|
+
|
|
134
|
+
```vue
|
|
135
|
+
<script setup lang="ts">
|
|
136
|
+
import 'x-next/style.css';
|
|
137
|
+
import { RadioGroup, Tabs, TabPane } from 'x-next';
|
|
138
|
+
import { ref } from 'vue';
|
|
139
|
+
|
|
140
|
+
const position = ref<'top' | 'right' | 'bottom' | 'left'>('left');
|
|
141
|
+
const positionOptions = [
|
|
142
|
+
{ label: 'Top', value: 'top' },
|
|
143
|
+
{ label: 'Right', value: 'right' },
|
|
144
|
+
{ label: 'Bottom', value: 'bottom' },
|
|
145
|
+
{ label: 'Left', value: 'left' },
|
|
146
|
+
];
|
|
147
|
+
</script>
|
|
148
|
+
<template>
|
|
149
|
+
<RadioGroup v-model="position" type="button" :options="positionOptions" />
|
|
150
|
+
<Tabs :position="position" type="card">
|
|
151
|
+
<TabPane key="overview" title="概览">当前标签栏位置:{{ position }}</TabPane>
|
|
152
|
+
<TabPane key="config" title="配置">左侧和右侧会切换为纵向导航</TabPane>
|
|
153
|
+
<TabPane key="log" title="日志">底部标签栏会显示在内容之后</TabPane>
|
|
154
|
+
</Tabs>
|
|
155
|
+
</template>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 可编辑标签
|
|
159
|
+
|
|
160
|
+
```vue
|
|
161
|
+
<script setup lang="ts">
|
|
162
|
+
import 'x-next/style.css';
|
|
163
|
+
import { Tabs, TabPane } from 'x-next';
|
|
164
|
+
import { ref } from 'vue';
|
|
165
|
+
|
|
166
|
+
const activeKey = ref('1');
|
|
167
|
+
const seed = ref(3);
|
|
168
|
+
const tabs = ref([
|
|
169
|
+
{ key: '1', title: '需求' },
|
|
170
|
+
{ key: '2', title: '设计' },
|
|
171
|
+
]);
|
|
172
|
+
|
|
173
|
+
const addTab = () => {
|
|
174
|
+
const key = String(seed.value++);
|
|
175
|
+
tabs.value.push({ key, title: `新标签 ${key}` });
|
|
176
|
+
};
|
|
177
|
+
const removeTab = (key: string | number) => {
|
|
178
|
+
tabs.value = tabs.value.filter((item) => item.key !== key);
|
|
179
|
+
};
|
|
180
|
+
</script>
|
|
181
|
+
<template>
|
|
182
|
+
<Tabs
|
|
183
|
+
v-model:active-key="activeKey"
|
|
184
|
+
type="card-gutter"
|
|
185
|
+
editable
|
|
186
|
+
show-add-button
|
|
187
|
+
auto-switch
|
|
188
|
+
@add="addTab"
|
|
189
|
+
@delete="removeTab"
|
|
190
|
+
>
|
|
191
|
+
<TabPane v-for="item in tabs" :key="item.key" :title="item.title">
|
|
192
|
+
{{ item.title }} 内容
|
|
193
|
+
</TabPane>
|
|
194
|
+
</Tabs>
|
|
195
|
+
</template>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### 插槽和额外内容
|
|
199
|
+
|
|
200
|
+
```vue
|
|
201
|
+
<script setup lang="ts">
|
|
202
|
+
import 'x-next/style.css';
|
|
203
|
+
import { Tabs, TabPane } from 'x-next';
|
|
204
|
+
import { ref } from 'vue';
|
|
205
|
+
|
|
206
|
+
const activeKey = ref('message');
|
|
207
|
+
</script>
|
|
208
|
+
<template>
|
|
209
|
+
<Tabs v-model:active-key="activeKey">
|
|
210
|
+
<template #extra>
|
|
211
|
+
<button>额外操作</button>
|
|
212
|
+
</template>
|
|
213
|
+
<TabPane key="message">
|
|
214
|
+
<template #title>消息</template>
|
|
215
|
+
自定义标题插槽
|
|
216
|
+
</TabPane>
|
|
217
|
+
<TabPane key="notice">
|
|
218
|
+
<template #title>通知</template>
|
|
219
|
+
标签栏右侧可以放置额外内容
|
|
220
|
+
</TabPane>
|
|
221
|
+
</Tabs>
|
|
222
|
+
</template>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### 懒加载和销毁
|
|
226
|
+
|
|
227
|
+
```vue
|
|
228
|
+
<script setup lang="ts">
|
|
229
|
+
import 'x-next/style.css';
|
|
230
|
+
import { Tabs, TabPane } from 'x-next';
|
|
231
|
+
import { defineComponent, h, onBeforeUnmount, onMounted, ref } from 'vue';
|
|
232
|
+
|
|
233
|
+
const activeKey = ref('first');
|
|
234
|
+
const mountCount = ref(0);
|
|
235
|
+
const unmountCount = ref(0);
|
|
236
|
+
const LifecyclePanel = defineComponent({
|
|
237
|
+
props: {
|
|
238
|
+
name: {
|
|
239
|
+
type: String,
|
|
240
|
+
required: true,
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
setup(props) {
|
|
244
|
+
onMounted(() => {
|
|
245
|
+
mountCount.value += 1;
|
|
246
|
+
});
|
|
247
|
+
onBeforeUnmount(() => {
|
|
248
|
+
unmountCount.value += 1;
|
|
249
|
+
});
|
|
250
|
+
return () => h('span', `${props.name} 已挂载`);
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
</script>
|
|
254
|
+
<template>
|
|
255
|
+
<Tabs v-model:active-key="activeKey" lazy-load destroy-on-hide animation>
|
|
256
|
+
<TabPane key="first" title="首次">
|
|
257
|
+
<LifecyclePanel name="首次面板" />
|
|
258
|
+
</TabPane>
|
|
259
|
+
<TabPane key="second" title="销毁">
|
|
260
|
+
<LifecyclePanel name="销毁面板" />
|
|
261
|
+
</TabPane>
|
|
262
|
+
<TabPane key="third" title="动画">
|
|
263
|
+
<LifecyclePanel name="动画面板" />
|
|
264
|
+
</TabPane>
|
|
265
|
+
</Tabs>
|
|
266
|
+
<p>挂载次数:{{ mountCount }};销毁次数:{{ unmountCount }}</p>
|
|
267
|
+
</template>
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Hover 触发
|
|
271
|
+
|
|
272
|
+
```vue
|
|
273
|
+
<script setup lang="ts">
|
|
274
|
+
import 'x-next/style.css';
|
|
275
|
+
import { Tabs, TabPane } from 'x-next';
|
|
276
|
+
import { ref } from 'vue';
|
|
277
|
+
|
|
278
|
+
const activeKey = ref('preview');
|
|
279
|
+
</script>
|
|
280
|
+
<template>
|
|
281
|
+
<Tabs v-model:active-key="activeKey" trigger="hover">
|
|
282
|
+
<TabPane key="preview" title="预览">鼠标移入即可切换</TabPane>
|
|
283
|
+
<TabPane key="detail" title="详情">适合轻量预览场景</TabPane>
|
|
284
|
+
</Tabs>
|
|
285
|
+
</template>
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### 滚动标签
|
|
289
|
+
|
|
290
|
+
```vue
|
|
291
|
+
<script setup lang="ts">
|
|
292
|
+
import 'x-next/style.css';
|
|
293
|
+
import { RadioGroup, Button, Tabs, TabPane } from 'x-next';
|
|
294
|
+
import { ref } from 'vue';
|
|
295
|
+
|
|
296
|
+
const activeKey = ref('tab-8');
|
|
297
|
+
const position = ref<'top' | 'right' | 'bottom' | 'left'>('top');
|
|
298
|
+
const scrollPosition = ref<'auto' | 'start' | 'center' | 'end'>('auto');
|
|
299
|
+
const positionOptions = [
|
|
300
|
+
{ label: 'Left', value: 'left' },
|
|
301
|
+
{ label: 'Top', value: 'top' },
|
|
302
|
+
{ label: 'Right', value: 'right' },
|
|
303
|
+
{ label: 'Bottom', value: 'bottom' },
|
|
304
|
+
];
|
|
305
|
+
const scrollPositionOptions = [
|
|
306
|
+
{ label: 'auto', value: 'auto' },
|
|
307
|
+
{ label: 'start', value: 'start' },
|
|
308
|
+
{ label: 'center', value: 'center' },
|
|
309
|
+
{ label: 'end', value: 'end' },
|
|
310
|
+
];
|
|
311
|
+
const tabs = Array.from({ length: 30 }, (_, index) => ({
|
|
312
|
+
key: `tab-${index + 1}`,
|
|
313
|
+
title: `标签 ${index + 1}`,
|
|
314
|
+
}));
|
|
315
|
+
|
|
316
|
+
const handleChangeActive = () => {
|
|
317
|
+
activeKey.value = `tab-${Math.floor(Math.random() * tabs.length) + 1}`;
|
|
318
|
+
};
|
|
319
|
+
</script>
|
|
320
|
+
<template>
|
|
321
|
+
<RadioGroup v-model="position" type="button" :options="positionOptions" />
|
|
322
|
+
<RadioGroup v-model="scrollPosition" type="button" :options="scrollPositionOptions" />
|
|
323
|
+
<Button size="small" @click="handleChangeActive">Change: {{ activeKey }}</Button>
|
|
324
|
+
<Tabs
|
|
325
|
+
v-model:active-key="activeKey"
|
|
326
|
+
:position="position"
|
|
327
|
+
:scroll-position="scrollPosition"
|
|
328
|
+
style="width: 100%; height: 300px"
|
|
329
|
+
>
|
|
330
|
+
<TabPane v-for="item in tabs" :key="item.key" :title="item.title">
|
|
331
|
+
{{ item.title }} 内容
|
|
332
|
+
</TabPane>
|
|
333
|
+
</Tabs>
|
|
334
|
+
</template>
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
返回 [AI 索引](../index.md)。先查本页与 [本地 API](./tabs-api.md);需要更深类型时查 [公开组件导航](../catalog.md),不默认上网查找本包用法。
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
|
|
2
|
+
# Tag 完整公开 API
|
|
3
|
+
|
|
4
|
+
适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
|
|
5
|
+
|
|
6
|
+
从同版本构建的公开声明、运行时 props/emits 和显式 expose 生成。运行时导入始终使用 `x-next`,声明路径仅作定位。插槽类型未细化时,具体槽名与作用域见本地用法示例。
|
|
7
|
+
|
|
8
|
+
## Tag API
|
|
9
|
+
|
|
10
|
+
公开声明:`dist/components/tag/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
|
|
11
|
+
|
|
12
|
+
### Props
|
|
13
|
+
|
|
14
|
+
| 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
|
|
15
|
+
| --- | --- | --- | --- | --- |
|
|
16
|
+
| color | 标签颜色,支持内置色或自定义 CSS 色值 | undefined | string | 否 | 未声明 |
|
|
17
|
+
| size | 标签尺寸 | undefined | "small" | "medium" | "large" | 否 | "medium" |
|
|
18
|
+
| bordered | 是否显示边框 | undefined | false | true | 否 | false |
|
|
19
|
+
| visible | 标签是否可见,支持 v-model:visible | undefined | false | true | 否 | undefined |
|
|
20
|
+
| defaultVisible | 默认是否可见,非受控模式 | undefined | false | true | 否 | true |
|
|
21
|
+
| loading | 是否为加载状态 | undefined | false | true | 否 | false |
|
|
22
|
+
| closable | 是否可关闭 | undefined | false | true | 否 | false |
|
|
23
|
+
| selectable | 是否可选择 | undefined | false | true | 否 | false |
|
|
24
|
+
| checked | 是否选中,仅 selectable 时有效,支持 v-model:checked | undefined | false | true | 否 | undefined |
|
|
25
|
+
| defaultChecked | 默认是否选中,非受控模式 | undefined | false | true | 否 | true |
|
|
26
|
+
| nowrap | 标签内容是否不换行 | undefined | false | true | 否 | false |
|
|
27
|
+
| closeAriaLabel | 关闭按钮的无障碍名称,默认“关闭标签” | undefined | string | 否 | 未声明 |
|
|
28
|
+
|
|
29
|
+
### Events
|
|
30
|
+
|
|
31
|
+
| 事件 | 用途 | 监听器签名(即事件参数) |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| update:visible | 可见状态变化时触发 | undefined | (visible: boolean) => any |
|
|
34
|
+
| update:checked | 选中状态变化时触发 | undefined | (checked: boolean) => any |
|
|
35
|
+
| close | 点击关闭按钮时触发 | undefined | (ev: MouseEvent) => any |
|
|
36
|
+
| check | 点击可选择标签时触发 | undefined | (checked: boolean, ev: MouseEvent) => any |
|
|
37
|
+
|
|
38
|
+
### Slots
|
|
39
|
+
|
|
40
|
+
| 名称 | 用途 | 公开类型 |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| default | 标签内容 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
43
|
+
| icon | 自定义图标 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
44
|
+
| close-icon | 自定义关闭图标 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
45
|
+
|
|
46
|
+
### 实例方法
|
|
47
|
+
|
|
48
|
+
没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
|
|
49
|
+
|
|
50
|
+
### 关联类型定义
|
|
51
|
+
|
|
52
|
+
以下摘自本组件族声明,供查阅嵌套配置;运行时和值类型均以根入口可导出项为准。
|
|
53
|
+
|
|
54
|
+
```typescript-reference
|
|
55
|
+
declare const TAG_COLORS: readonly ["red", "orangered", "orange", "gold", "lime", "green", "cyan", "blue", "better-blue", "purple", "pink-purple", "magenta", "gray"];
|
|
56
|
+
|
|
57
|
+
type TagColor = (typeof TAG_COLORS)[number];
|
|
58
|
+
|
|
59
|
+
interface TagProps {
|
|
60
|
+
/**
|
|
61
|
+
* @zh 标签的颜色
|
|
62
|
+
* @en Label color
|
|
63
|
+
*/
|
|
64
|
+
color?: TagColor | string;
|
|
65
|
+
/**
|
|
66
|
+
* @zh 标签的大小
|
|
67
|
+
* @en Label size
|
|
68
|
+
*/
|
|
69
|
+
size?: 'small' | 'medium' | 'large';
|
|
70
|
+
/**
|
|
71
|
+
* @zh 标签是否可见
|
|
72
|
+
* @en Whether the tag is visible
|
|
73
|
+
*/
|
|
74
|
+
visible?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* @zh 标签默认是否可见
|
|
77
|
+
* @en Whether the tag is visible by default
|
|
78
|
+
*/
|
|
79
|
+
defaultVisible?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* @zh 标签是否为加载中状态
|
|
82
|
+
* @en Whether the tag is loading state
|
|
83
|
+
*/
|
|
84
|
+
loading?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* @zh 标签是否可关闭
|
|
87
|
+
* @en Whether the tag can be closed
|
|
88
|
+
*/
|
|
89
|
+
closable?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* @zh 标签是否可选中
|
|
92
|
+
* @en Whether the tag can be checked
|
|
93
|
+
*/
|
|
94
|
+
selectable?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* @zh 标签是否选中(标签可选中时可用)
|
|
97
|
+
* @en Whether the tag is checked (available when the tag is selectable)
|
|
98
|
+
*/
|
|
99
|
+
checked?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* @zh 标签默认选中状态(标签可选中时可用)
|
|
102
|
+
* @en Whether the tag is checked by default (available when the tag is selectable)
|
|
103
|
+
*/
|
|
104
|
+
defaultChecked?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* @zh 是否显示边框
|
|
107
|
+
* @en Whether the tag is bordered
|
|
108
|
+
*/
|
|
109
|
+
bordered?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* @zh 标签内容不换行
|
|
112
|
+
* @en Tag content does not wrap
|
|
113
|
+
*/
|
|
114
|
+
nowrap?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* @zh 关闭按钮的无障碍名称,默认“关闭标签”
|
|
117
|
+
* @en Accessible name of the close button, defaults to "关闭标签"
|
|
118
|
+
*/
|
|
119
|
+
closeAriaLabel?: string;
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
返回 [Tag 用法](./tag.md)。
|