@fox-js/phone-skills 4.0.1-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/README.md +30 -0
- package/foxui/SKILL.md +442 -0
- package/foxui/references/fox-action-sheet/doc.md +74 -0
- package/foxui/references/fox-actionsheet-item/doc.md +499 -0
- package/foxui/references/fox-animate/doc.md +66 -0
- package/foxui/references/fox-audio/doc.md +76 -0
- package/foxui/references/fox-avatar/doc.md +70 -0
- package/foxui/references/fox-back-top/doc.md +69 -0
- package/foxui/references/fox-badge/doc.md +72 -0
- package/foxui/references/fox-barrage/doc.md +116 -0
- package/foxui/references/fox-button/doc.md +203 -0
- package/foxui/references/fox-calendar/doc.md +346 -0
- package/foxui/references/fox-calendar-item/doc.md +331 -0
- package/foxui/references/fox-cascader/doc.md +78 -0
- package/foxui/references/fox-cascader-item/doc.md +710 -0
- package/foxui/references/fox-cell/doc.md +74 -0
- package/foxui/references/fox-checkbox-item/doc.md +387 -0
- package/foxui/references/fox-circle-progress/doc.md +65 -0
- package/foxui/references/fox-collapse/doc.md +71 -0
- package/foxui/references/fox-count-down/doc.md +78 -0
- package/foxui/references/fox-count-up/doc.md +178 -0
- package/foxui/references/fox-date-item/doc.md +437 -0
- package/foxui/references/fox-date-picker/doc.md +438 -0
- package/foxui/references/fox-dialog/doc.md +242 -0
- package/foxui/references/fox-divider/doc.md +149 -0
- package/foxui/references/fox-domain-provider/doc.md +93 -0
- package/foxui/references/fox-drag/doc.md +64 -0
- package/foxui/references/fox-dropdown/doc.md +138 -0
- package/foxui/references/fox-elevator/doc.md +66 -0
- package/foxui/references/fox-ellipsis/doc.md +69 -0
- package/foxui/references/fox-empty/doc.md +67 -0
- package/foxui/references/fox-fixed-nav/doc.md +72 -0
- package/foxui/references/fox-floating-button/doc.md +142 -0
- package/foxui/references/fox-grid/doc.md +69 -0
- package/foxui/references/fox-group/doc.md +295 -0
- package/foxui/references/fox-icon/doc.md +65 -0
- package/foxui/references/fox-image/doc.md +75 -0
- package/foxui/references/fox-image-preview/doc.md +79 -0
- package/foxui/references/fox-indicator/doc.md +70 -0
- package/foxui/references/fox-infinite-loading/doc.md +74 -0
- package/foxui/references/fox-input-item/doc.md +210 -0
- package/foxui/references/fox-input-number/doc.md +199 -0
- package/foxui/references/fox-input-number-item/doc.md +213 -0
- package/foxui/references/fox-item/doc.md +207 -0
- package/foxui/references/fox-layout/doc.md +273 -0
- package/foxui/references/fox-link-item/doc.md +158 -0
- package/foxui/references/fox-list/doc.md +71 -0
- package/foxui/references/fox-mapping/doc.md +251 -0
- package/foxui/references/fox-menu/doc.md +425 -0
- package/foxui/references/fox-message-box/doc.md +200 -0
- package/foxui/references/fox-money-item/doc.md +174 -0
- package/foxui/references/fox-more-button/doc.md +208 -0
- package/foxui/references/fox-navbar/doc.md +75 -0
- package/foxui/references/fox-notice-bar/doc.md +71 -0
- package/foxui/references/fox-notify/doc.md +72 -0
- package/foxui/references/fox-number-keyboard/doc.md +77 -0
- package/foxui/references/fox-over-lay/doc.md +70 -0
- package/foxui/references/fox-page/doc.md +76 -0
- package/foxui/references/fox-pagination/doc.md +73 -0
- package/foxui/references/fox-picker/doc.md +668 -0
- package/foxui/references/fox-picker-item/doc.md +389 -0
- package/foxui/references/fox-popover/doc.md +70 -0
- package/foxui/references/fox-popover-dialog/doc.md +113 -0
- package/foxui/references/fox-popup/doc.md +88 -0
- package/foxui/references/fox-price/doc.md +67 -0
- package/foxui/references/fox-progress/doc.md +74 -0
- package/foxui/references/fox-pull-refresh/doc.md +77 -0
- package/foxui/references/fox-radio-item/doc.md +384 -0
- package/foxui/references/fox-range/doc.md +65 -0
- package/foxui/references/fox-rate/doc.md +141 -0
- package/foxui/references/fox-rate-item/doc.md +137 -0
- package/foxui/references/fox-rolling-provider/doc.md +87 -0
- package/foxui/references/fox-search-bar/doc.md +91 -0
- package/foxui/references/fox-short-password/doc.md +78 -0
- package/foxui/references/fox-side-nav-bar/doc.md +68 -0
- package/foxui/references/fox-signature/doc.md +202 -0
- package/foxui/references/fox-skeleton/doc.md +73 -0
- package/foxui/references/fox-steps/doc.md +162 -0
- package/foxui/references/fox-steps-bar/doc.md +610 -0
- package/foxui/references/fox-sticky/doc.md +68 -0
- package/foxui/references/fox-swipe/doc.md +176 -0
- package/foxui/references/fox-swiper/doc.md +254 -0
- package/foxui/references/fox-switch/doc.md +162 -0
- package/foxui/references/fox-switch-item/doc.md +190 -0
- package/foxui/references/fox-tabbar/doc.md +63 -0
- package/foxui/references/fox-table/doc.md +640 -0
- package/foxui/references/fox-tabs/doc.md +67 -0
- package/foxui/references/fox-tabs-bar/doc.md +533 -0
- package/foxui/references/fox-tag/doc.md +213 -0
- package/foxui/references/fox-text/doc.md +84 -0
- package/foxui/references/fox-textarea-item/doc.md +106 -0
- package/foxui/references/fox-toast/doc.md +149 -0
- package/foxui/references/fox-tour/doc.md +89 -0
- package/foxui/references/fox-trend-arrow/doc.md +72 -0
- package/foxui/references/fox-uploader/doc.md +96 -0
- package/foxui/references/fox-video/doc.md +245 -0
- package/foxui/references/fox-water-mark/doc.md +81 -0
- package/package.json +21 -0
|
@@ -0,0 +1,610 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: 江成
|
|
3
|
+
* @Date: 2026-04-27 00:37:28
|
|
4
|
+
* @LastEditors: 江成
|
|
5
|
+
* @LastEditTime: 2026-05-12 22:33:21
|
|
6
|
+
-->
|
|
7
|
+
---
|
|
8
|
+
title: StepsBar 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 步骤栏
|
|
12
|
+
tags: [foxui, fox-steps-bar, FoxStepsBar]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js","fox-group","fox-row-item","fox-text"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# StepsBar 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
StepsBar 是 foxui 中用于 **步骤栏** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-steps-bar` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
23
|
+
- **核心增强**: 基于 NutUI 组件二次封装、支持 v-model 双向绑定、支持禁用/只读状态、适配 H5 与小程序多端、支持插槽扩展自定义内容、支持主题定制
|
|
24
|
+
- **适用场景**: 步骤栏
|
|
25
|
+
|
|
26
|
+
> 💡 **关键原则**: 在所有 步骤栏 中,**必须**优先使用此组件,禁止直接使用原生 NutUI 组件。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. 关键 API 说明 (Key API)
|
|
31
|
+
|
|
32
|
+
### 2.1 Props 属性
|
|
33
|
+
|
|
34
|
+
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|
|
35
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
36
|
+
| `direction` | 显示方向,horizontal,vertical | string | horizontal |
|
|
37
|
+
| `mode` | 步骤栏模式 | simple | - |
|
|
38
|
+
| `model-value` | 当前步骤 | string \ | number \ |
|
|
39
|
+
| `disabled` | 是否禁用 | boolean | false |
|
|
40
|
+
| `data` | 步骤数据源 | Array,Function,String | - |
|
|
41
|
+
| `params` | 查询参数 | Record<string,any> | - |
|
|
42
|
+
| `text-key` | 指定异构数据源的text key | String | "text" |
|
|
43
|
+
| `value-key` | 指定异构数据源的value key | String | "value" |
|
|
44
|
+
| `disabled-key` | 指定异构数据源的disabled key | String | "disabled" |
|
|
45
|
+
| `status-key` | 指定异构数据源的status key | String | "status" |
|
|
46
|
+
| `visible-key` | 指定异构数据源的visible key | String | "visible" |
|
|
47
|
+
| `doit-key` | 点状 key item doit映射-异构转换 | String | "doit" |
|
|
48
|
+
| `label-key` | icon中标签名item label映射-异构转换 | String | "label" |
|
|
49
|
+
| `item-options` | option样式设置 | ItemOption | - |
|
|
50
|
+
| `icon` | 步骤 icon | Component | - |
|
|
51
|
+
| `icon-size` | icon大小 | number | - |
|
|
52
|
+
| `mark-icon` | 激活指示icon | Component | - |
|
|
53
|
+
| `mark-icon-size` | 指示icon大小 | number | - |
|
|
54
|
+
| `step` | 步长。direction为vertical为高度,direction为horizontal为宽度 | number | - |
|
|
55
|
+
| `click-navigate-policy` | 点击导航策略 | 'only-back' \ | 'only-back-reset' \ |
|
|
56
|
+
| `layout` | 布局,mode优先高于layout,mode可以看成预设的layout | head \ | main \ |
|
|
57
|
+
| `scroll` | 可滚动 | boolea | false |
|
|
58
|
+
|
|
59
|
+
### 2.2 Events 事件
|
|
60
|
+
|
|
61
|
+
| 事件名 | 类型 | 说明 |
|
|
62
|
+
| :--- | :--- | :--- |
|
|
63
|
+
| `change` | 步骤改变 | value: Value, options: Record<string,any> |
|
|
64
|
+
|
|
65
|
+
### 2.3 Methods 方法
|
|
66
|
+
|
|
67
|
+
| 方法名 | 参数 | 说明 |
|
|
68
|
+
| :--- | :--- | :--- |
|
|
69
|
+
无
|
|
70
|
+
|
|
71
|
+
### 2.4 Slots 插槽
|
|
72
|
+
|
|
73
|
+
| 插槽名 | 说明 |
|
|
74
|
+
| :--- | :--- |
|
|
75
|
+
| `main` | 步骤内容 |
|
|
76
|
+
| `sub` | 步骤次内容 |
|
|
77
|
+
| `icon` | 步骤图标 |
|
|
78
|
+
| `mark` | 步骤指示图标 |
|
|
79
|
+
|
|
80
|
+
## 3. 例子 (Examples)
|
|
81
|
+
|
|
82
|
+
## 代码演示
|
|
83
|
+
|
|
84
|
+
### 基本用法
|
|
85
|
+
|
|
86
|
+
```html
|
|
87
|
+
<template>
|
|
88
|
+
<h2>基础用法</h2>
|
|
89
|
+
<div class="my-steps-wrap">
|
|
90
|
+
<fox-steps-bar v-model="curBasicStep" :data="basicSteps"></fox-steps-bar>
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
93
|
+
|
|
94
|
+
<script lang="ts" setup>
|
|
95
|
+
import { ref } from 'vue'
|
|
96
|
+
|
|
97
|
+
// setps数据
|
|
98
|
+
const basicSteps = [
|
|
99
|
+
{
|
|
100
|
+
text: '步骤一',
|
|
101
|
+
value: '01'
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
text: '步骤二',
|
|
105
|
+
value: '02'
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
text: '步骤三',
|
|
109
|
+
value: '03'
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
|
|
113
|
+
// 基础step value
|
|
114
|
+
const curBasicStep = ref('01')
|
|
115
|
+
</script>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 点状形状
|
|
119
|
+
|
|
120
|
+
```html
|
|
121
|
+
<template>
|
|
122
|
+
<h2>点状结构</h2>
|
|
123
|
+
<div class="my-steps-wrap">
|
|
124
|
+
<fox-steps-bar v-model="curDoitStep" :data="basicSteps" :item-options="itemDoitOptions"></fox-steps-bar>
|
|
125
|
+
</div>
|
|
126
|
+
</template>
|
|
127
|
+
|
|
128
|
+
<script lang="ts" setup>
|
|
129
|
+
import { ref } from 'vue'
|
|
130
|
+
|
|
131
|
+
// setps数据
|
|
132
|
+
const basicSteps = [
|
|
133
|
+
{
|
|
134
|
+
text: '步骤一',
|
|
135
|
+
value: '01'
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
text: '步骤二',
|
|
139
|
+
value: '02'
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
text: '步骤三',
|
|
143
|
+
value: '03'
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
|
|
147
|
+
// 点状step value
|
|
148
|
+
const curDoitStep = ref('02')
|
|
149
|
+
// item 点状 options
|
|
150
|
+
const itemDoitOptions = (item: Record<string, number>, index: number) => {
|
|
151
|
+
const s: Record<string, any> = {
|
|
152
|
+
doit: true
|
|
153
|
+
}
|
|
154
|
+
if (index < 1) {
|
|
155
|
+
s['status'] = 'done'
|
|
156
|
+
}
|
|
157
|
+
return s
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
</script>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### 简易布局
|
|
164
|
+
|
|
165
|
+
组件预设的布局,比较紧凑简单,通过属性`mode=“simple”`设置
|
|
166
|
+
|
|
167
|
+
```html
|
|
168
|
+
<template>
|
|
169
|
+
<h2>简易布局</h2>
|
|
170
|
+
<div class="my-steps-wrap">
|
|
171
|
+
<fox-steps-bar v-model="curSimpleStep" :data="basicSteps" mode="simple"></fox-steps-bar>
|
|
172
|
+
</div>
|
|
173
|
+
</template>
|
|
174
|
+
|
|
175
|
+
<script lang="ts" setup>
|
|
176
|
+
import { ref } from 'vue'
|
|
177
|
+
|
|
178
|
+
// setps数据
|
|
179
|
+
const basicSteps = [
|
|
180
|
+
{
|
|
181
|
+
text: '步骤一',
|
|
182
|
+
value: '01'
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
text: '步骤二',
|
|
186
|
+
value: '02'
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
text: '步骤三',
|
|
190
|
+
value: '03'
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
|
|
194
|
+
// 简易step value
|
|
195
|
+
const curSimpleStep = ref('')
|
|
196
|
+
</script>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### 状态
|
|
200
|
+
可以通过步骤元素中的`status`设置每个步骤的状态
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
```ts
|
|
204
|
+
/**
|
|
205
|
+
* Step状态
|
|
206
|
+
*/
|
|
207
|
+
export type StepStatus = 'done' | 'error' | 'half' | ''
|
|
208
|
+
/**
|
|
209
|
+
* Value类型
|
|
210
|
+
*/
|
|
211
|
+
export type Value = string | number | boolean
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Step Item
|
|
215
|
+
*/
|
|
216
|
+
export interface Item {
|
|
217
|
+
text: string //标题
|
|
218
|
+
value: Value //value
|
|
219
|
+
status?: StepStatus //状态
|
|
220
|
+
visible?: boolean //是否可见
|
|
221
|
+
disabled?: boolean //是否禁用
|
|
222
|
+
[propName: string]: any
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
```html
|
|
229
|
+
<template>
|
|
230
|
+
<h2>状态</h2>
|
|
231
|
+
<div class="my-steps-wrap">
|
|
232
|
+
<fox-steps-bar v-model="curStatusStep" :data="statusSteps"></fox-steps-bar>
|
|
233
|
+
</div>
|
|
234
|
+
</template>
|
|
235
|
+
|
|
236
|
+
<script lang="ts" setup>
|
|
237
|
+
import { ref } from 'vue'
|
|
238
|
+
|
|
239
|
+
// setps数据
|
|
240
|
+
export const statusSteps = [
|
|
241
|
+
{
|
|
242
|
+
text: '完成',
|
|
243
|
+
value: '01',
|
|
244
|
+
status: 'done'
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
text: '错误',
|
|
248
|
+
value: '02',
|
|
249
|
+
status: 'error'
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
text: '半完成',
|
|
253
|
+
value: '03',
|
|
254
|
+
status: 'half'
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
text: '当前',
|
|
258
|
+
value: '04'
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
text: '默认',
|
|
262
|
+
value: '05'
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
|
|
266
|
+
// 状态step value
|
|
267
|
+
const curStatusStep = ref('04')
|
|
268
|
+
</script>
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### 自定义Icon
|
|
272
|
+
|
|
273
|
+
通过插槽`icon`设置步骤的图标
|
|
274
|
+
|
|
275
|
+
```html
|
|
276
|
+
<template>
|
|
277
|
+
<h2>自定义Icon</h2>
|
|
278
|
+
<div class="my-steps-wrap">
|
|
279
|
+
<fox-steps-bar v-model="curIconStep" :data="statusSteps">
|
|
280
|
+
<template v-slot:icon="scope">
|
|
281
|
+
<Checked v-if="scope.status === 'done'"></Checked>
|
|
282
|
+
<MaskClose v-else-if="scope.status === 'error'"></MaskClose>
|
|
283
|
+
<Loading v-else-if="scope.status === 'half'"></Loading>
|
|
284
|
+
<CheckChecked v-else></CheckChecked>
|
|
285
|
+
</template>
|
|
286
|
+
</fox-steps-bar>
|
|
287
|
+
</div>
|
|
288
|
+
</template>
|
|
289
|
+
|
|
290
|
+
<script lang="ts" setup>
|
|
291
|
+
import { ref } from 'vue'
|
|
292
|
+
import { Checked, Loading, CheckChecked, MaskClose } from '@fox-js/icons-vue'
|
|
293
|
+
|
|
294
|
+
// setps数据
|
|
295
|
+
export const statusSteps = [
|
|
296
|
+
{
|
|
297
|
+
text: '完成',
|
|
298
|
+
value: '01',
|
|
299
|
+
status: 'done'
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
text: '错误',
|
|
303
|
+
value: '02',
|
|
304
|
+
status: 'error'
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
text: '半完成',
|
|
308
|
+
value: '03',
|
|
309
|
+
status: 'half'
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
text: '当前',
|
|
313
|
+
value: '04'
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
text: '默认',
|
|
317
|
+
value: '05'
|
|
318
|
+
}
|
|
319
|
+
]
|
|
320
|
+
|
|
321
|
+
// 状态step value
|
|
322
|
+
const curIconStep = ref('04')
|
|
323
|
+
</script>
|
|
324
|
+
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### 可滚动
|
|
328
|
+
通过设置属性`scroll`和`step`来设置step栏的可滚动,其中`step`属性来设置步长。`direction`为`vertical`为高度,`direction`为`horizontal`为宽度。
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
```html
|
|
333
|
+
<template>
|
|
334
|
+
<h2>可滚动</h2>
|
|
335
|
+
<div class="my-steps-wrap">
|
|
336
|
+
<fox-steps-bar
|
|
337
|
+
class="my-scroll-steps--"
|
|
338
|
+
v-model="curScrollStep"
|
|
339
|
+
:data="moreSteps"
|
|
340
|
+
:scroll="true"
|
|
341
|
+
step="80px"
|
|
342
|
+
></fox-steps-bar>
|
|
343
|
+
</div>
|
|
344
|
+
</template>
|
|
345
|
+
|
|
346
|
+
<script lang="ts" setup>
|
|
347
|
+
import { ref } from 'vue'
|
|
348
|
+
|
|
349
|
+
// setps数据
|
|
350
|
+
export const moreSteps = [
|
|
351
|
+
{
|
|
352
|
+
text: '步骤一',
|
|
353
|
+
value: '01',
|
|
354
|
+
status: 'done'
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
text: '步骤二',
|
|
358
|
+
value: '02'
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
text: '步骤三',
|
|
362
|
+
value: '03'
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
text: '步骤四',
|
|
366
|
+
value: '04'
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
text: '步骤六',
|
|
370
|
+
value: '06'
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
text: '步骤七',
|
|
374
|
+
value: '07'
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
text: '步骤八',
|
|
378
|
+
value: '08'
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
text: '步骤九',
|
|
382
|
+
value: '09'
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
text: '步骤十',
|
|
386
|
+
value: '10'
|
|
387
|
+
}
|
|
388
|
+
]
|
|
389
|
+
|
|
390
|
+
// 可滚动step value
|
|
391
|
+
const curScrollStep = ref('08')
|
|
392
|
+
</script>
|
|
393
|
+
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
### 垂直方向
|
|
397
|
+
通过设置属性`direction`设置步骤的方向。
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
```html
|
|
402
|
+
<template>
|
|
403
|
+
<h2>垂直方向</h2>
|
|
404
|
+
<div class="my-steps-wrap my-steps-wrap--vertical">
|
|
405
|
+
<fox-steps-bar
|
|
406
|
+
class="my-scroll-steps--vertical"
|
|
407
|
+
v-model="curVerticalScrollStep"
|
|
408
|
+
:data="moreSteps"
|
|
409
|
+
:scroll="true"
|
|
410
|
+
step="80px"
|
|
411
|
+
direction="vertical"
|
|
412
|
+
></fox-steps-bar>
|
|
413
|
+
</div>
|
|
414
|
+
</template>
|
|
415
|
+
|
|
416
|
+
<script lang="ts" setup>
|
|
417
|
+
import { ref } from 'vue'
|
|
418
|
+
|
|
419
|
+
// setps数据
|
|
420
|
+
export const moreSteps = [
|
|
421
|
+
{
|
|
422
|
+
text: '步骤一',
|
|
423
|
+
value: '01',
|
|
424
|
+
status: 'done'
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
text: '步骤二',
|
|
428
|
+
value: '02'
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
text: '步骤三',
|
|
432
|
+
value: '03'
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
text: '步骤四',
|
|
436
|
+
value: '04'
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
text: '步骤六',
|
|
440
|
+
value: '06'
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
text: '步骤七',
|
|
444
|
+
value: '07'
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
text: '步骤八',
|
|
448
|
+
value: '08'
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
text: '步骤九',
|
|
452
|
+
value: '09'
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
text: '步骤十',
|
|
456
|
+
value: '10'
|
|
457
|
+
}
|
|
458
|
+
]
|
|
459
|
+
|
|
460
|
+
// 可滚动垂直step value
|
|
461
|
+
const curVerticalScrollStep = ref('01')
|
|
462
|
+
</script>
|
|
463
|
+
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
### 自定义布局
|
|
467
|
+
通过设置属性`layout`设置步骤栏的布局。
|
|
468
|
+
例如
|
|
469
|
+
|
|
470
|
+
```html
|
|
471
|
+
|
|
472
|
+
<!--通过layout设置步骤栏的组成部分(head、main和sub),并且组成部分的排列属性-->
|
|
473
|
+
<fox-steps-bar :layout="['head', 'main', 'sub']"></fox-steps-bar>
|
|
474
|
+
|
|
475
|
+
```
|
|
476
|
+
`layout`数组的可设置部分为
|
|
477
|
+
|
|
478
|
+
```ts
|
|
479
|
+
/**
|
|
480
|
+
* layout类型
|
|
481
|
+
*/
|
|
482
|
+
export type LayoutType = 'head' | 'main' | 'sub' | 'mark'
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
```html
|
|
487
|
+
<template>
|
|
488
|
+
<h2>自定义布局</h2>
|
|
489
|
+
<div class="my-steps-wrap my-steps-wrap--vertical">
|
|
490
|
+
<fox-steps-bar
|
|
491
|
+
class="my-flow-steps"
|
|
492
|
+
v-model="curCustomStep"
|
|
493
|
+
:data="formatflowSteps"
|
|
494
|
+
:scroll="true"
|
|
495
|
+
step="80px"
|
|
496
|
+
direction="vertical"
|
|
497
|
+
value-key="id"
|
|
498
|
+
:item-options="itemOptions"
|
|
499
|
+
:layout="['sub', 'head', 'main']"
|
|
500
|
+
>
|
|
501
|
+
<template v-slot:sub="scope">
|
|
502
|
+
<fox-group class="my-flow-steps__left">
|
|
503
|
+
<fox-row-item align="right">
|
|
504
|
+
<fox-text class="title">{{ scope.item.time }}</fox-text>
|
|
505
|
+
</fox-row-item>
|
|
506
|
+
<fox-row-item align="right">
|
|
507
|
+
<fox-text>{{ scope.item.date }}</fox-text>
|
|
508
|
+
</fox-row-item>
|
|
509
|
+
</fox-group>
|
|
510
|
+
</template>
|
|
511
|
+
<template v-slot:main="scope">
|
|
512
|
+
<fox-group class="my-flow-steps__right">
|
|
513
|
+
<fox-row-item align="left">
|
|
514
|
+
<fox-text class="title">{{ getStatusText(scope.index) }}</fox-text>
|
|
515
|
+
</fox-row-item>
|
|
516
|
+
<fox-row-item align="space-between">
|
|
517
|
+
<fox-text>{{ scope.item.name }}({{ scope.item.id }})</fox-text>
|
|
518
|
+
<fox-text type="success" mark>提交</fox-text>
|
|
519
|
+
</fox-row-item>
|
|
520
|
+
<fox-row-item align="left">
|
|
521
|
+
<fox-text color="#FFAA08FF" text-color="#333333FF">
|
|
522
|
+
<template v-slot:mark>
|
|
523
|
+
<Issue></Issue>
|
|
524
|
+
</template>
|
|
525
|
+
{{ scope.item.tip }}
|
|
526
|
+
</fox-text>
|
|
527
|
+
</fox-row-item>
|
|
528
|
+
</fox-group>
|
|
529
|
+
</template>
|
|
530
|
+
</fox-steps-bar>
|
|
531
|
+
</div>
|
|
532
|
+
</template>
|
|
533
|
+
|
|
534
|
+
<script lang="ts" setup>
|
|
535
|
+
import { ref } from 'vue'
|
|
536
|
+
import { Issue } from '@fox-js/icons-vue'
|
|
537
|
+
|
|
538
|
+
// setps数据
|
|
539
|
+
export const flowSteps = [
|
|
540
|
+
{
|
|
541
|
+
id: '01',
|
|
542
|
+
name: '陈圆圆',
|
|
543
|
+
tip: '该客户资质尚可,为我行存量客户',
|
|
544
|
+
date: '02-07',
|
|
545
|
+
time: '14:35'
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
id: '02',
|
|
549
|
+
name: '貂蝉',
|
|
550
|
+
tip: '资产负债有风险',
|
|
551
|
+
date: '03-07',
|
|
552
|
+
time: '17:35'
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
id: '03',
|
|
556
|
+
name: '杨玉环',
|
|
557
|
+
tip: '该客户资质尚可,为我行存量客户',
|
|
558
|
+
date: '03-07',
|
|
559
|
+
time: '17:35'
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
id: '04',
|
|
563
|
+
name: '王昭君',
|
|
564
|
+
tip: '该客户资质尚可,为我行存量客户',
|
|
565
|
+
date: '03-07',
|
|
566
|
+
time: '17:35'
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
id: '05',
|
|
570
|
+
name: '苏小小',
|
|
571
|
+
tip: '该客户资质尚可,为我行存量客户',
|
|
572
|
+
date: '03-07',
|
|
573
|
+
time: '17:35'
|
|
574
|
+
}
|
|
575
|
+
]
|
|
576
|
+
|
|
577
|
+
// 审批流程,倒序排列
|
|
578
|
+
const formatflowSteps = computed(() => {
|
|
579
|
+
return [...flowSteps].reverse()
|
|
580
|
+
})
|
|
581
|
+
// 自定义step value
|
|
582
|
+
const curCustomStep = ref(formatflowSteps.value[0].id)
|
|
583
|
+
// item options
|
|
584
|
+
const itemOptions = (item: Record<string, number>, index: number) => {
|
|
585
|
+
if (index > 0) {
|
|
586
|
+
return {
|
|
587
|
+
status: 'done'
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
return {
|
|
591
|
+
status: 'done'
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
// 获取状态text
|
|
595
|
+
const getStatusText = (index: number) => {
|
|
596
|
+
if (index == 0) {
|
|
597
|
+
return '审批中'
|
|
598
|
+
}
|
|
599
|
+
return '审批完成'
|
|
600
|
+
}
|
|
601
|
+
</script>
|
|
602
|
+
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
## 4. 相关组件 (Related Components)
|
|
606
|
+
- **fox-js**: 与 StepsBar 配合使用的相关组件
|
|
607
|
+
- **fox-group**: 与 StepsBar 配合使用的相关组件
|
|
608
|
+
- **fox-row-item**: 与 StepsBar 配合使用的相关组件
|
|
609
|
+
- **fox-text**: 与 StepsBar 配合使用的相关组件
|
|
610
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: 江成
|
|
3
|
+
* @Date: 2026-04-27 00:37:28
|
|
4
|
+
* @LastEditors: 江成
|
|
5
|
+
* @LastEditTime: 2026-05-12 22:33:21
|
|
6
|
+
-->
|
|
7
|
+
---
|
|
8
|
+
title: Sticky 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 当组件在屏幕范围内时,会按照正常的布局排列,当组件滚出屏幕范围时,始终会固定在距离屏幕固定的距离处
|
|
12
|
+
tags: [foxui, fox-sticky, FoxSticky]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-cell","fox-button"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Sticky 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
Sticky 是 foxui 中用于 **当组件在屏幕范围内时,会按照正常的布局排列,当组件滚出屏幕范围时,始终会固定在距离屏幕固定的距离处** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-sticky` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
23
|
+
- **核心增强**: 基于 NutUI 组件二次封装、适配 H5 与小程序多端
|
|
24
|
+
- **适用场景**: 当组件在屏幕范围内时,会按照正常的布局排列,当组件滚出屏幕范围时,始终会固定在距离屏幕固定的距离处
|
|
25
|
+
|
|
26
|
+
> 💡 **关键原则**: 在所有 当组件在屏幕范围内时,会按照正常的布局排列,当组件滚出屏幕范围时,始终会固定在距离屏幕固定的距离处 中,**必须**优先使用此组件,禁止直接使用原生 NutUI 组件。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. 关键 API 说明 (Key API)
|
|
31
|
+
|
|
32
|
+
### 2.1 Props 属性
|
|
33
|
+
|
|
34
|
+
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|
|
35
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
36
|
+
| `position` | 吸附位置(top、bottom) | String | top |
|
|
37
|
+
| `top` | 吸顶距离 | Number | 0 |
|
|
38
|
+
| `bottom` | 吸底距离 | Number | 0 |
|
|
39
|
+
| `container` | 容器的 HTML 节点或者ID, 在小程序环境下需要同时指定 id | Element | - |
|
|
40
|
+
| `z-index` | 吸附时的层级 | Number | 2000 |
|
|
41
|
+
|
|
42
|
+
### 2.2 Events 事件
|
|
43
|
+
|
|
44
|
+
| 事件名 | 类型 | 说明 |
|
|
45
|
+
| :--- | :--- | :--- |
|
|
46
|
+
| `change` | 吸附状态改变时触发 | val: Boolean |
|
|
47
|
+
| `scroll` | 滚动时触发 | top: Number, fixed: Boolean |
|
|
48
|
+
|
|
49
|
+
### 2.3 Methods 方法
|
|
50
|
+
|
|
51
|
+
| 方法名 | 参数 | 说明 |
|
|
52
|
+
| :--- | :--- | :--- |
|
|
53
|
+
无
|
|
54
|
+
|
|
55
|
+
### 2.4 Slots 插槽
|
|
56
|
+
|
|
57
|
+
| 插槽名 | 说明 |
|
|
58
|
+
| :--- | :--- |
|
|
59
|
+
无
|
|
60
|
+
|
|
61
|
+
## 3. 例子 (Examples)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## 4. 相关组件 (Related Components)
|
|
66
|
+
- **fox-cell**: 与 Sticky 配合使用的相关组件
|
|
67
|
+
- **fox-button**: 与 Sticky 配合使用的相关组件
|
|
68
|
+
|