x-next 1.13.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 +380 -3
- 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 +33651 -5
- package/CHANGELOG.md +18 -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/es/_utils/inherit-component-type.js +6 -0
- package/dist/es/components/date-picker/index.js +18 -17
- package/dist/es/components/form-input/index.js +12 -11
- package/dist/es/components/layout/index.js +10 -9
- package/dist/es/components/menu/hooks/use-level.js +5 -5
- package/dist/es/components/menu/index.js +13 -10
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/package.json +10 -5
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
|
|
2
|
+
# Space AI 使用
|
|
3
|
+
|
|
4
|
+
适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
|
|
5
|
+
|
|
6
|
+
先读 [通用接入](../core.md)。公开导出:`Space`;主要模型:无。完整 Props、Events、Slots、实例方法与服务签名见 [本地 API](./space-api.md),包含本组件族全部子组件和别名。
|
|
7
|
+
|
|
8
|
+
按需样式:`x-next/style/space`(包含 base.css、space.css)。代码块未单独引样式时在应用入口加载全量样式,或按实际所有组件加载 JS 入口;不要仅因复制一个组件页就漏掉其中的 Button 等组合依赖。
|
|
9
|
+
|
|
10
|
+
## 场景用法
|
|
11
|
+
|
|
12
|
+
以下示例从本地 `src/docs/components/space.md` 显式导入到独立 AI 源,补齐局部注册、状态和样式后进行严格模板检查。上方已核验行为优先;原始 prop 默认值、包装透传和示例业务适配分别查 [完整 API](./space-api.md) 与场景说明。类型通过不代表所有散文和交互已验证。
|
|
13
|
+
|
|
14
|
+
### 用途与选型
|
|
15
|
+
|
|
16
|
+
用于在行内或纵向排列的一组元素之间设置统一间距。
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### 基础用法
|
|
20
|
+
|
|
21
|
+
```vue
|
|
22
|
+
<script setup lang="ts">
|
|
23
|
+
import 'x-next/style.css';
|
|
24
|
+
import { Space, Button } from 'x-next';
|
|
25
|
+
|
|
26
|
+
</script>
|
|
27
|
+
<template>
|
|
28
|
+
<Space size="medium">
|
|
29
|
+
<Button>取消</Button>
|
|
30
|
+
<Button type="primary">确定</Button>
|
|
31
|
+
<Button status="danger">删除</Button>
|
|
32
|
+
</Space>
|
|
33
|
+
</template>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 垂直间距
|
|
37
|
+
|
|
38
|
+
```vue
|
|
39
|
+
<script setup lang="ts">
|
|
40
|
+
import 'x-next/style.css';
|
|
41
|
+
import { Space, Alert } from 'x-next';
|
|
42
|
+
|
|
43
|
+
</script>
|
|
44
|
+
<template>
|
|
45
|
+
<Space direction="vertical" size="medium">
|
|
46
|
+
<Alert type="info">第一条提示</Alert>
|
|
47
|
+
<Alert type="success">第二条提示</Alert>
|
|
48
|
+
<Alert type="warning">第三条提示</Alert>
|
|
49
|
+
</Space>
|
|
50
|
+
</template>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 间距尺寸
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<script setup lang="ts">
|
|
57
|
+
import 'x-next/style.css';
|
|
58
|
+
import { Space, Tag } from 'x-next';
|
|
59
|
+
|
|
60
|
+
</script>
|
|
61
|
+
<template>
|
|
62
|
+
<Space size="mini">
|
|
63
|
+
<Tag>mini</Tag>
|
|
64
|
+
<Tag>mini</Tag>
|
|
65
|
+
<Tag>mini</Tag>
|
|
66
|
+
</Space>
|
|
67
|
+
<Space size="medium">
|
|
68
|
+
<Tag>medium</Tag>
|
|
69
|
+
<Tag>medium</Tag>
|
|
70
|
+
<Tag>medium</Tag>
|
|
71
|
+
</Space>
|
|
72
|
+
<Space :size="24">
|
|
73
|
+
<Tag>24px</Tag>
|
|
74
|
+
<Tag>24px</Tag>
|
|
75
|
+
<Tag>24px</Tag>
|
|
76
|
+
</Space>
|
|
77
|
+
</template>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 对齐方式
|
|
81
|
+
|
|
82
|
+
```vue
|
|
83
|
+
<script setup lang="ts">
|
|
84
|
+
import 'x-next/style.css';
|
|
85
|
+
import { Space, Button, Tag } from 'x-next';
|
|
86
|
+
|
|
87
|
+
</script>
|
|
88
|
+
<template>
|
|
89
|
+
<Space align="start">
|
|
90
|
+
<Button>顶部对齐</Button>
|
|
91
|
+
<Tag size="large">Large Tag</Tag>
|
|
92
|
+
<span style="font-size: 12px">小字号文本</span>
|
|
93
|
+
</Space>
|
|
94
|
+
<Space align="baseline">
|
|
95
|
+
<Button>基线对齐</Button>
|
|
96
|
+
<Tag size="large">Large Tag</Tag>
|
|
97
|
+
<span style="font-size: 12px">小字号文本</span>
|
|
98
|
+
</Space>
|
|
99
|
+
</template>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 撑满宽度
|
|
103
|
+
|
|
104
|
+
`fill` 让组件自身撑满父容器宽度,并让每个间距项等分可用空间;垂直方向的间距项会拉伸交叉轴,宽度 100% 的表单控件因此能真正撑满。横向排列不需要 `fill` 时,用 `block` 配合 `style="width: 100%"`。
|
|
105
|
+
|
|
106
|
+
```vue
|
|
107
|
+
<script setup lang="ts">
|
|
108
|
+
import 'x-next/style.css';
|
|
109
|
+
import { Space, Button, Input } from 'x-next';
|
|
110
|
+
|
|
111
|
+
</script>
|
|
112
|
+
<template>
|
|
113
|
+
<Space block align="space-between" style="width: 100%">
|
|
114
|
+
<Button>上一页</Button>
|
|
115
|
+
<Button type="primary">下一页</Button>
|
|
116
|
+
</Space>
|
|
117
|
+
<Space fill direction="vertical" size="medium">
|
|
118
|
+
<Input placeholder="第一行撑满" />
|
|
119
|
+
<Input placeholder="第二行撑满" />
|
|
120
|
+
</Space>
|
|
121
|
+
</template>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### 分隔符
|
|
125
|
+
|
|
126
|
+
```vue
|
|
127
|
+
<script setup lang="ts">
|
|
128
|
+
import 'x-next/style.css';
|
|
129
|
+
import { Space, Link } from 'x-next';
|
|
130
|
+
|
|
131
|
+
</script>
|
|
132
|
+
<template>
|
|
133
|
+
<Space>
|
|
134
|
+
<template #split>
|
|
135
|
+
<span>/</span>
|
|
136
|
+
</template>
|
|
137
|
+
<Link>首页</Link>
|
|
138
|
+
<Link>组件</Link>
|
|
139
|
+
<Link>Space</Link>
|
|
140
|
+
</Space>
|
|
141
|
+
</template>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
返回 [AI 索引](../index.md)。先查本页与 [本地 API](./space-api.md);需要更深类型时查 [公开组件导航](../catalog.md),不默认上网查找本包用法。
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
|
|
2
|
+
# Spin 完整公开 API
|
|
3
|
+
|
|
4
|
+
适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
|
|
5
|
+
|
|
6
|
+
从同版本构建的公开声明、运行时 props/emits 和显式 expose 生成。运行时导入始终使用 `x-next`,声明路径仅作定位。插槽类型未细化时,具体槽名与作用域见本地用法示例。
|
|
7
|
+
|
|
8
|
+
## Spin API
|
|
9
|
+
|
|
10
|
+
公开声明:`dist/components/spin/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
|
|
11
|
+
|
|
12
|
+
### Props
|
|
13
|
+
|
|
14
|
+
| 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
|
|
15
|
+
| --- | --- | --- | --- | --- |
|
|
16
|
+
| display | 容器显示方式 | undefined | "block" | "inline" | 否 | "inline" |
|
|
17
|
+
| size | 图标或点状动画单点尺寸 | undefined | number | 否 | 未声明 |
|
|
18
|
+
| loading | 是否为加载中状态,仅容器模式下覆盖内容 | undefined | false | true | 否 | false(Vue Boolean 转换) |
|
|
19
|
+
| delay | 延迟显示加载态的毫秒数,避免快速请求闪烁;仅容器模式生效,结束时立即收起 | undefined | number | 否 | 0 |
|
|
20
|
+
| dot | 是否使用点状动画 | undefined | false | true | "default" | "color" | 否 | false(Vue Boolean 转换) |
|
|
21
|
+
| tip | 提示内容 | undefined | string | 否 | 未声明 |
|
|
22
|
+
| hideIcon | 是否隐藏图标 | undefined | false | true | 否 | false |
|
|
23
|
+
| tipShimmer | 提示文字是否开启扫光效果,需要同时设置 tip | undefined | false | true | 否 | false |
|
|
24
|
+
|
|
25
|
+
### Events
|
|
26
|
+
|
|
27
|
+
未声明组件 emits;原生事件与包装透传按本页用法核实。
|
|
28
|
+
|
|
29
|
+
### Slots
|
|
30
|
+
|
|
31
|
+
| 名称 | 用途 | 公开类型 |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| default | 容器模式下的内容 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
34
|
+
| icon | 自定义图标,会向第一个组件注入 spin 属性 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
35
|
+
| element | 自定义加载元素 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
36
|
+
| tip | 自定义提示内容 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
37
|
+
|
|
38
|
+
### 实例方法
|
|
39
|
+
|
|
40
|
+
没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
返回 [Spin 用法](./spin.md)。
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
|
|
2
|
+
# Spin AI 使用
|
|
3
|
+
|
|
4
|
+
适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
|
|
5
|
+
|
|
6
|
+
先读 [通用接入](../core.md)。公开导出:`Spin`;主要模型:无。完整 Props、Events、Slots、实例方法与服务签名见 [本地 API](./spin-api.md),包含本组件族全部子组件和别名。
|
|
7
|
+
|
|
8
|
+
按需样式:`x-next/style/spin`(包含 base.css、spin.css)。代码块未单独引样式时在应用入口加载全量样式,或按实际所有组件加载 JS 入口;不要仅因复制一个组件页就漏掉其中的 Button 等组合依赖。
|
|
9
|
+
|
|
10
|
+
## 场景用法
|
|
11
|
+
|
|
12
|
+
以下示例从本地 `src/docs/components/spin.md` 显式导入到独立 AI 源,补齐局部注册、状态和样式后进行严格模板检查。上方已核验行为优先;原始 prop 默认值、包装透传和示例业务适配分别查 [完整 API](./spin-api.md) 与场景说明。类型通过不代表所有散文和交互已验证。
|
|
13
|
+
|
|
14
|
+
### 用途与选型
|
|
15
|
+
|
|
16
|
+
用于局部区域或页面等待状态。
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### 何时使用
|
|
20
|
+
|
|
21
|
+
- 页面、卡片、表格等区域正在等待异步数据。
|
|
22
|
+
- 操作提交后需要短暂阻止用户继续操作当前区域。
|
|
23
|
+
- 需要用提示文本降低等待过程中的不确定感。
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### 基础用法
|
|
27
|
+
|
|
28
|
+
```vue
|
|
29
|
+
<script setup lang="ts">
|
|
30
|
+
import 'x-next/style.css';
|
|
31
|
+
import { Spin } from 'x-next';
|
|
32
|
+
|
|
33
|
+
</script>
|
|
34
|
+
<template>
|
|
35
|
+
<Spin />
|
|
36
|
+
<Spin tip="加载中" />
|
|
37
|
+
</template>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 尺寸
|
|
41
|
+
|
|
42
|
+
```vue
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
import 'x-next/style.css';
|
|
45
|
+
import { Spin } from 'x-next';
|
|
46
|
+
|
|
47
|
+
</script>
|
|
48
|
+
<template>
|
|
49
|
+
<Spin :size="16" />
|
|
50
|
+
<Spin :size="24" />
|
|
51
|
+
<Spin :size="36" tip="处理中" />
|
|
52
|
+
</template>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 容器模式
|
|
56
|
+
|
|
57
|
+
```vue
|
|
58
|
+
<script setup lang="ts">
|
|
59
|
+
import 'x-next/style.css';
|
|
60
|
+
import { Button, Spin } from 'x-next';
|
|
61
|
+
import { ref } from 'vue';
|
|
62
|
+
|
|
63
|
+
const loading = ref(true);
|
|
64
|
+
</script>
|
|
65
|
+
<template>
|
|
66
|
+
<Button size="small" @click="loading = !loading">
|
|
67
|
+
{{ loading ? '结束加载' : '开始加载' }}
|
|
68
|
+
</Button>
|
|
69
|
+
<Spin :loading="loading" display="block" tip="加载中">
|
|
70
|
+
<div class="panel">
|
|
71
|
+
<strong>内容区域</strong>
|
|
72
|
+
<p>加载时遮罩会覆盖内容,并暂时阻止内部控件聚焦。</p>
|
|
73
|
+
<Button size="small">区域操作</Button>
|
|
74
|
+
</div>
|
|
75
|
+
</Spin>
|
|
76
|
+
</template>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 点状动画
|
|
80
|
+
|
|
81
|
+
```vue
|
|
82
|
+
<script setup lang="ts">
|
|
83
|
+
import 'x-next/style.css';
|
|
84
|
+
import { Spin } from 'x-next';
|
|
85
|
+
|
|
86
|
+
</script>
|
|
87
|
+
<template>
|
|
88
|
+
<Spin dot />
|
|
89
|
+
<Spin dot="color" />
|
|
90
|
+
<Spin dot="color" :size="10" tip="同步中" />
|
|
91
|
+
</template>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 隐藏图标
|
|
95
|
+
|
|
96
|
+
```vue
|
|
97
|
+
<script setup lang="ts">
|
|
98
|
+
import 'x-next/style.css';
|
|
99
|
+
import { Spin } from 'x-next';
|
|
100
|
+
|
|
101
|
+
</script>
|
|
102
|
+
<template>
|
|
103
|
+
<Spin hide-icon tip="正在连接服务" />
|
|
104
|
+
<Spin :loading="true" display="block" hide-icon tip="正在保存">
|
|
105
|
+
<div class="panel">表单内容</div>
|
|
106
|
+
</Spin>
|
|
107
|
+
</template>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 自定义内容
|
|
111
|
+
|
|
112
|
+
```vue
|
|
113
|
+
<script setup lang="ts">
|
|
114
|
+
import 'x-next/style.css';
|
|
115
|
+
import { Spin } from 'x-next';
|
|
116
|
+
|
|
117
|
+
</script>
|
|
118
|
+
<template>
|
|
119
|
+
<Spin tip="自定义图标">
|
|
120
|
+
<template #icon>
|
|
121
|
+
<span class="custom-icon">⌁</span>
|
|
122
|
+
</template>
|
|
123
|
+
</Spin>
|
|
124
|
+
<Spin tip="自定义元素">
|
|
125
|
+
<template #element>
|
|
126
|
+
<span class="custom-loading" aria-hidden="true"></span>
|
|
127
|
+
</template>
|
|
128
|
+
</Spin>
|
|
129
|
+
<Spin>
|
|
130
|
+
<template #tip>
|
|
131
|
+
<span>请稍候,正在处理</span>
|
|
132
|
+
</template>
|
|
133
|
+
</Spin>
|
|
134
|
+
</template>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 文案扫光
|
|
138
|
+
|
|
139
|
+
`tipShimmer` 让提示文字出现一条横向扫过的光带,比静止文案更醒目。仅对 `tip` prop 生效(自定义 `tip` 插槽内容结构未知,不参与扫光)。
|
|
140
|
+
|
|
141
|
+
光带颜色与周期由两个 token 控制,可在主题层或局部覆盖:
|
|
142
|
+
|
|
143
|
+
```vue
|
|
144
|
+
<script setup lang="ts">
|
|
145
|
+
import 'x-next/style.css';
|
|
146
|
+
import { Spin } from 'x-next';
|
|
147
|
+
|
|
148
|
+
</script>
|
|
149
|
+
<template>
|
|
150
|
+
<Spin tip="加载中" tip-shimmer />
|
|
151
|
+
<Spin tip="正在同步数据" tip-shimmer :size="32" />
|
|
152
|
+
</template>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### 延迟显示
|
|
156
|
+
|
|
157
|
+
快速请求往往几十毫秒内就结束。直接切 `loading` 会让遮罩闪一下又消失,观感比不加加载态更差。`delay` 让加载态延后出现,这段时间内结束的请求不会有任何闪烁。
|
|
158
|
+
|
|
159
|
+
`delay` 只延迟**出现**:加载结束时立即收起遮罩,不会让已加载好的内容再被多盖一段时间。因此快请求不闪、慢请求也不拖。
|
|
160
|
+
|
|
161
|
+
```vue
|
|
162
|
+
<script setup lang="ts">
|
|
163
|
+
import 'x-next/style.css';
|
|
164
|
+
import { Button, Spin } from 'x-next';
|
|
165
|
+
import { ref } from 'vue';
|
|
166
|
+
|
|
167
|
+
const loading = ref(false);
|
|
168
|
+
|
|
169
|
+
// 120ms 结束:早于 delay,遮罩不出现,不会闪
|
|
170
|
+
const runFast = () => {
|
|
171
|
+
loading.value = true;
|
|
172
|
+
window.setTimeout(() => {
|
|
173
|
+
loading.value = false;
|
|
174
|
+
}, 120);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
// 1.2s 结束:遮罩在 300ms 时出现
|
|
178
|
+
const runSlow = () => {
|
|
179
|
+
loading.value = true;
|
|
180
|
+
window.setTimeout(() => {
|
|
181
|
+
loading.value = false;
|
|
182
|
+
}, 1200);
|
|
183
|
+
};
|
|
184
|
+
</script>
|
|
185
|
+
<template>
|
|
186
|
+
<Button @click="runFast">快请求(120ms 结束)</Button>
|
|
187
|
+
<Button @click="runSlow">慢请求(1.2s 结束)</Button>
|
|
188
|
+
<Spin :loading="loading" :delay="300" display="block" tip="加载中">
|
|
189
|
+
<div class="panel">内容区域</div>
|
|
190
|
+
</Spin>
|
|
191
|
+
</template>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### 交互说明
|
|
195
|
+
|
|
196
|
+
- 容器模式下,`loading` 为 `true` 时会显示遮罩,并给内容区域加上不可聚焦状态。不支持 `inert` 的旧浏览器会退化为给内部可聚焦元素临时加 `tabindex="-1"`,加载结束后还原。
|
|
197
|
+
- `delay` 只对容器模式生效;独立形态本身就是加载指示器,`loading` 与 `delay` 都不参与。
|
|
198
|
+
- Spin 根节点默认带有加载语义;没有提示文本时会使用默认可访问名称。
|
|
199
|
+
- `icon` 插槽会向第一个组件注入 `spin` 属性;若传入普通元素,可自行添加动画样式,或使用 `element` 插槽完全自定义。
|
|
200
|
+
- 开启系统「减弱动态效果」后,图标旋转、点状动画与文案扫光都会停止;扫光会还原成纯色,避免光带停在文字上留下一块亮斑。
|
|
201
|
+
- 提示文字的行高由组件显式声明(`--x-line-height-base`),不继承宿主行高,因此在任意项目里高度一致。
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
返回 [AI 索引](../index.md)。先查本页与 [本地 API](./spin-api.md);需要更深类型时查 [公开组件导航](../catalog.md),不默认上网查找本包用法。
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
|
|
2
|
+
# Steps 完整公开 API
|
|
3
|
+
|
|
4
|
+
适用版本:x-next@1.14.0;来源指纹:`014984639d816a2c7e25eb22690c586b0b2e8efba6846bec8a4e424db41a09e9`。
|
|
5
|
+
|
|
6
|
+
从同版本构建的公开声明、运行时 props/emits 和显式 expose 生成。运行时导入始终使用 `x-next`,声明路径仅作定位。插槽类型未细化时,具体槽名与作用域见本地用法示例。
|
|
7
|
+
|
|
8
|
+
## Step API
|
|
9
|
+
|
|
10
|
+
公开声明:`dist/components/steps/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
|
|
11
|
+
|
|
12
|
+
### Props
|
|
13
|
+
|
|
14
|
+
| 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
|
|
15
|
+
| --- | --- | --- | --- | --- |
|
|
16
|
+
| title | 步骤标题 | undefined | string | 否 | 未声明 |
|
|
17
|
+
| description | 步骤描述 | undefined | string | 否 | 未声明 |
|
|
18
|
+
| status | 步骤状态,设置后会覆盖 Steps 自动计算 | undefined | "error" | "wait" | "process" | "finish" | 否 | 未声明 |
|
|
19
|
+
| disabled | 是否禁用点击 | undefined | false | true | 否 | false |
|
|
20
|
+
|
|
21
|
+
### Events
|
|
22
|
+
|
|
23
|
+
未声明组件 emits;原生事件与包装透传按本页用法核实。
|
|
24
|
+
|
|
25
|
+
### Slots
|
|
26
|
+
|
|
27
|
+
| 名称 | 用途 | 公开类型 |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| node | 自定义节点 | any |
|
|
30
|
+
| description | 自定义描述内容 | any |
|
|
31
|
+
| icon | 自定义图标 | any |
|
|
32
|
+
| default | 自定义标题内容 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
|
|
33
|
+
|
|
34
|
+
### 实例方法
|
|
35
|
+
|
|
36
|
+
没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
|
|
37
|
+
|
|
38
|
+
### 关联类型定义
|
|
39
|
+
|
|
40
|
+
以下摘自本组件族声明,供查阅嵌套配置;运行时和值类型均以根入口可导出项为准。
|
|
41
|
+
|
|
42
|
+
```typescript-reference
|
|
43
|
+
declare const STEPS_TYPES: readonly ["default", "arrow", "dot", "navigation"];
|
|
44
|
+
|
|
45
|
+
type StepsType = typeof STEPS_TYPES[number];
|
|
46
|
+
|
|
47
|
+
declare const STEP_STATUSES: readonly ["wait", "process", "finish", "error"];
|
|
48
|
+
|
|
49
|
+
type StepStatus = typeof STEP_STATUSES[number];
|
|
50
|
+
|
|
51
|
+
interface StepData {
|
|
52
|
+
step: number;
|
|
53
|
+
status: StepStatus;
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## Steps API
|
|
59
|
+
|
|
60
|
+
公开声明:`dist/components/steps/index.d.ts`。 类型中的 undefined 表示可省略;原始 prop 默认值不等于继承配置或服务默认值。
|
|
61
|
+
|
|
62
|
+
### Props
|
|
63
|
+
|
|
64
|
+
| 名称 | 用途 | 公开类型 | 必填 | 声明默认值 |
|
|
65
|
+
| --- | --- | --- | --- | --- |
|
|
66
|
+
| type | 步骤条类型 | undefined | "default" | "dot" | "arrow" | "navigation" | 否 | "default" |
|
|
67
|
+
| direction | 显示方向 | undefined | "horizontal" | "vertical" | 否 | "horizontal" |
|
|
68
|
+
| labelPlacement | 标签描述放置位置 | undefined | "horizontal" | "vertical" | 否 | "horizontal" |
|
|
69
|
+
| current | 当前步骤,按 1 开始计数 | undefined | number | 否 | undefined |
|
|
70
|
+
| defaultCurrent | 默认步骤,非受控模式 | undefined | number | 否 | 1 |
|
|
71
|
+
| status | 当前步骤状态 | undefined | "error" | "wait" | "process" | "finish" | 否 | "process" |
|
|
72
|
+
| lineLess | 是否使用无连接线样式 | undefined | false | true | 否 | false |
|
|
73
|
+
| small | 是否使用小尺寸,dot 模式不生效 | undefined | false | true | 否 | false |
|
|
74
|
+
| changeable | 是否可点击切换 | undefined | false | true | 否 | false |
|
|
75
|
+
|
|
76
|
+
### Events
|
|
77
|
+
|
|
78
|
+
| 事件 | 用途 | 监听器签名(即事件参数) |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| update:current | 当前步骤变化时触发 | undefined | (step: number) => any |
|
|
81
|
+
| change | 当前步骤变化时触发 | undefined | (step: number, ev: Event) => any |
|
|
82
|
+
|
|
83
|
+
### Slots
|
|
84
|
+
|
|
85
|
+
公开类型未逐项声明插槽;本页场景说明列出实际使用的插槽,不将任意插槽视为已支持。
|
|
86
|
+
|
|
87
|
+
### 实例方法
|
|
88
|
+
|
|
89
|
+
没有检索到显式 expose 或 Options API methods 的公开方法;不把 setup 内部函数当成稳定实例 API。
|
|
90
|
+
|
|
91
|
+
### 关联类型定义
|
|
92
|
+
|
|
93
|
+
以下摘自本组件族声明,供查阅嵌套配置;运行时和值类型均以根入口可导出项为准。
|
|
94
|
+
|
|
95
|
+
```typescript-reference
|
|
96
|
+
declare const STEPS_TYPES: readonly ["default", "arrow", "dot", "navigation"];
|
|
97
|
+
|
|
98
|
+
type StepsType = typeof STEPS_TYPES[number];
|
|
99
|
+
|
|
100
|
+
declare const STEP_STATUSES: readonly ["wait", "process", "finish", "error"];
|
|
101
|
+
|
|
102
|
+
type StepStatus = typeof STEP_STATUSES[number];
|
|
103
|
+
|
|
104
|
+
interface StepData {
|
|
105
|
+
step: number;
|
|
106
|
+
status: StepStatus;
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
返回 [Steps 用法](./steps.md)。
|