@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,533 @@
|
|
|
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: TabsBar 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 选项卡栏
|
|
12
|
+
tags: [foxui, fox-tabs-bar, FoxTabsBar]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js","fox-tabs-container","fox-tabs-pane","fox-tabs-frame","fox-tabs","fox-tabpane"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# TabsBar 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
TabsBar 是 foxui 中用于 **选项卡栏** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-tabs-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
|
+
| `v-model` | 绑定当前选中标签的标识符 | number,string | - |
|
|
37
|
+
| `direction` | 是否支持拖拽 | 'horizontal' | 'vertical' |
|
|
38
|
+
| `width` | 容器宽度 | string/number |
|
|
39
|
+
| `height` | 容器高度 | string/number |
|
|
40
|
+
|
|
41
|
+
### 2.2 Events 事件
|
|
42
|
+
|
|
43
|
+
| 事件名 | 类型 | 说明 |
|
|
44
|
+
| :--- | :--- | :--- |
|
|
45
|
+
| `change` | 当前激活的标签改变时触发 | item, index |
|
|
46
|
+
|
|
47
|
+
### 2.3 Methods 方法
|
|
48
|
+
|
|
49
|
+
| 方法名 | 参数 | 说明 |
|
|
50
|
+
| :--- | :--- | :--- |
|
|
51
|
+
无
|
|
52
|
+
|
|
53
|
+
### 2.4 Slots 插槽
|
|
54
|
+
|
|
55
|
+
| 插槽名 | 说明 |
|
|
56
|
+
| :--- | :--- |
|
|
57
|
+
| `item` | 自定义标签 |
|
|
58
|
+
| `text` | 自定义text |
|
|
59
|
+
| `navigation` | 导航插槽 |
|
|
60
|
+
| `popupItem` | 快速导航标签插槽 |
|
|
61
|
+
| `navigation` | 导航插槽 |
|
|
62
|
+
| `leftArrow` | 左箭头插槽 |
|
|
63
|
+
| `rightArrow` | 左箭头插槽 |
|
|
64
|
+
|
|
65
|
+
## 3. 例子 (Examples)
|
|
66
|
+
|
|
67
|
+
## 代码演示
|
|
68
|
+
|
|
69
|
+
### 基础用法
|
|
70
|
+
```html
|
|
71
|
+
<template>
|
|
72
|
+
<h2>基础用法</h2>
|
|
73
|
+
<fox-tabs-bar v-model="baseSelectedValue" :data="baseTabs"></fox-tabs-bar>
|
|
74
|
+
</template>
|
|
75
|
+
<script lang="ts" setup>
|
|
76
|
+
// 基础数据源
|
|
77
|
+
const baseTabs = [
|
|
78
|
+
{
|
|
79
|
+
text: 'Tab 1',
|
|
80
|
+
value: '01'
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
text: 'Tab 2',
|
|
84
|
+
value: '02'
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
text: 'Tab 3',
|
|
88
|
+
value: '03'
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
// base selected value
|
|
92
|
+
const baseSelectedValue = ref('01')
|
|
93
|
+
</script>
|
|
94
|
+
```
|
|
95
|
+
### 左对齐
|
|
96
|
+
通过属性`align`设置标签左对齐
|
|
97
|
+
```html
|
|
98
|
+
<template>
|
|
99
|
+
<h2>左对齐</h2>
|
|
100
|
+
<fox-tabs-bar v-model="leftSelectedValue" :data="baseTabs" align="left"></fox-tabs-bar>
|
|
101
|
+
</template>
|
|
102
|
+
<script lang="ts" setup>
|
|
103
|
+
// 基础数据源
|
|
104
|
+
const baseTabs = [
|
|
105
|
+
{
|
|
106
|
+
text: 'Tab 1',
|
|
107
|
+
value: '01'
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
text: 'Tab 2',
|
|
111
|
+
value: '02'
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
text: 'Tab 3',
|
|
115
|
+
value: '03'
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
// left selected value
|
|
119
|
+
const leftSelectedValue = ref('')
|
|
120
|
+
</script>
|
|
121
|
+
```
|
|
122
|
+
### 可滚动
|
|
123
|
+
在数量过多的情况下,通过属性`scroll`设置标签可滚动
|
|
124
|
+
```html
|
|
125
|
+
<template>
|
|
126
|
+
<h2>可滚动</h2>
|
|
127
|
+
<fox-tabs-bar v-model="moreSelectedValue" :data="moreTabs" :scroll="true" gutter="10px"></fox-tabs-bar>
|
|
128
|
+
</template>
|
|
129
|
+
<script lang="ts" setup>
|
|
130
|
+
// 更多数据源
|
|
131
|
+
const moreTabs = [
|
|
132
|
+
{
|
|
133
|
+
text: 'Tab 1',
|
|
134
|
+
value: '01'
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
text: 'Tab 2',
|
|
138
|
+
value: '02'
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
text: 'Tab 3',
|
|
142
|
+
value: '03'
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
text: 'Tab 4',
|
|
146
|
+
value: '04'
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
text: 'Tab 5',
|
|
150
|
+
value: '05'
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
text: 'Tab 6',
|
|
154
|
+
value: '06'
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
text: 'Tab 7',
|
|
158
|
+
value: '07'
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
text: 'Tab 8',
|
|
162
|
+
value: '08'
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
text: 'Tab 9',
|
|
166
|
+
value: '09'
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
text: 'Tab 10',
|
|
170
|
+
value: '10'
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
// more selected value
|
|
174
|
+
const moreSelectedValue = ref('')
|
|
175
|
+
</script>
|
|
176
|
+
```
|
|
177
|
+
### 标签形状
|
|
178
|
+
可以通过属性`shape`设置标签的形状
|
|
179
|
+
```html
|
|
180
|
+
<template>
|
|
181
|
+
<h2>按钮形状</h2>
|
|
182
|
+
<fox-tabs-bar v-model="buttonSelectedValue" :data="moreTabs" :scroll="true" shape="button"></fox-tabs-bar>
|
|
183
|
+
<h2>按钮组形状</h2>
|
|
184
|
+
<fox-tabs-bar v-model="buttonGroupSelectedValue" :data="buttonGroupTabs" shape="button-group"></fox-tabs-bar>
|
|
185
|
+
<h2>胶囊形状</h2>
|
|
186
|
+
<fox-tabs-bar
|
|
187
|
+
v-model="capsuleGroupSelectedValue"
|
|
188
|
+
:data="capsuleGroupTabs"
|
|
189
|
+
shape="capsule"
|
|
190
|
+
:scroll="true"
|
|
191
|
+
></fox-tabs-bar>
|
|
192
|
+
</template>
|
|
193
|
+
<script lang="ts" setup>
|
|
194
|
+
// 更多数据源
|
|
195
|
+
export const moreTabs = [
|
|
196
|
+
{
|
|
197
|
+
text: 'Tab 1',
|
|
198
|
+
value: '01'
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
text: 'Tab 2',
|
|
202
|
+
value: '02'
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
text: 'Tab 3',
|
|
206
|
+
value: '03'
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
text: 'Tab 4',
|
|
210
|
+
value: '04'
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
text: 'Tab 5',
|
|
214
|
+
value: '05'
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
text: 'Tab 6',
|
|
218
|
+
value: '06'
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
text: 'Tab 7',
|
|
222
|
+
value: '07'
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
text: 'Tab 8',
|
|
226
|
+
value: '08'
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
text: 'Tab 9',
|
|
230
|
+
value: '09'
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
text: 'Tab 10',
|
|
234
|
+
value: '10'
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
// 按钮组tabs
|
|
238
|
+
export const buttonGroupTabs = [
|
|
239
|
+
{
|
|
240
|
+
text: '按钮组1',
|
|
241
|
+
value: '01'
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
text: '按钮组2',
|
|
245
|
+
value: '02'
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
text: '按钮组3',
|
|
249
|
+
value: '03'
|
|
250
|
+
}
|
|
251
|
+
]
|
|
252
|
+
// 胶囊tabs
|
|
253
|
+
export const capsuleGroupTabs = [
|
|
254
|
+
{
|
|
255
|
+
text: '胶囊1',
|
|
256
|
+
value: '01'
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
text: '胶囊2',
|
|
260
|
+
value: '02'
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
text: '胶囊3',
|
|
264
|
+
value: '03'
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
text: '胶囊4',
|
|
268
|
+
value: '04'
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
// button shape selected value
|
|
272
|
+
const buttonSelectedValue = ref('06')
|
|
273
|
+
// button group shape selected value
|
|
274
|
+
const buttonGroupSelectedValue = ref('')
|
|
275
|
+
// capsule group shape selected value
|
|
276
|
+
const capsuleGroupSelectedValue = ref('')
|
|
277
|
+
</script>
|
|
278
|
+
```
|
|
279
|
+
### 快速导航
|
|
280
|
+
```html
|
|
281
|
+
<template>
|
|
282
|
+
<h2>快速导航</h2>
|
|
283
|
+
<fox-tabs-bar
|
|
284
|
+
v-model="quickSelectedValue"
|
|
285
|
+
:data="moreTabs"
|
|
286
|
+
:scroll="true"
|
|
287
|
+
:show-quick-navigation="true"
|
|
288
|
+
shape="button"
|
|
289
|
+
></fox-tabs-bar>
|
|
290
|
+
</template>
|
|
291
|
+
<script lang="ts" setup>
|
|
292
|
+
// 更多数据源
|
|
293
|
+
export const moreTabs = [
|
|
294
|
+
{
|
|
295
|
+
text: 'Tab 1',
|
|
296
|
+
value: '01'
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
text: 'Tab 2',
|
|
300
|
+
value: '02'
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
text: 'Tab 3',
|
|
304
|
+
value: '03'
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
text: 'Tab 4',
|
|
308
|
+
value: '04'
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
text: 'Tab 5',
|
|
312
|
+
value: '05'
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
text: 'Tab 6',
|
|
316
|
+
value: '06'
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
text: 'Tab 7',
|
|
320
|
+
value: '07'
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
text: 'Tab 8',
|
|
324
|
+
value: '08'
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
text: 'Tab 9',
|
|
328
|
+
value: '09'
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
text: 'Tab 10',
|
|
332
|
+
value: '10'
|
|
333
|
+
}
|
|
334
|
+
]
|
|
335
|
+
// quick selected value
|
|
336
|
+
const quickSelectedValue = ref('06')
|
|
337
|
+
</script>
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### 箭头指示
|
|
341
|
+
```html
|
|
342
|
+
<template>
|
|
343
|
+
<h2>箭头指示</h2>
|
|
344
|
+
<fox-tabs-bar
|
|
345
|
+
v-model="scrollArrowSelectedValue"
|
|
346
|
+
:data="moreTabs"
|
|
347
|
+
:scroll="true"
|
|
348
|
+
:show-scroll-arrow="true"
|
|
349
|
+
shape="button"
|
|
350
|
+
></fox-tabs-bar>
|
|
351
|
+
</template>
|
|
352
|
+
<script lang="ts" setup>
|
|
353
|
+
// 更多数据源
|
|
354
|
+
export const moreTabs = [
|
|
355
|
+
{
|
|
356
|
+
text: 'Tab 1',
|
|
357
|
+
value: '01'
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
text: 'Tab 2',
|
|
361
|
+
value: '02'
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
text: 'Tab 3',
|
|
365
|
+
value: '03'
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
text: 'Tab 4',
|
|
369
|
+
value: '04'
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
text: 'Tab 5',
|
|
373
|
+
value: '05'
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
text: 'Tab 6',
|
|
377
|
+
value: '06'
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
text: 'Tab 7',
|
|
381
|
+
value: '07'
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
text: 'Tab 8',
|
|
385
|
+
value: '08'
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
text: 'Tab 9',
|
|
389
|
+
value: '09'
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
text: 'Tab 10',
|
|
393
|
+
value: '10'
|
|
394
|
+
}
|
|
395
|
+
]
|
|
396
|
+
// scroll arrow selected value
|
|
397
|
+
const scrollArrowSelectedValue = ref('')
|
|
398
|
+
</script>
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### 徽标提示
|
|
402
|
+
```html
|
|
403
|
+
<template>
|
|
404
|
+
<h2>徽标提示</h2>
|
|
405
|
+
<fox-tabs-bar v-model="logoTipsSelectedValue" :data="baseTabs" :item-options="logoTipsItemOptions"></fox-tabs-bar>
|
|
406
|
+
<fox-tabs-container v-model="logoTipsSelectedValue">
|
|
407
|
+
<fox-tabs-pane v-for="(tab, index) in baseTabs" :pane-key="tab.value" :key="tab.value">
|
|
408
|
+
<div style="text-align: center; padding: 30px">{{ tab.text }}</div>
|
|
409
|
+
</fox-tabs-pane>
|
|
410
|
+
</fox-tabs-container>
|
|
411
|
+
</template>
|
|
412
|
+
<script lang="ts" setup>
|
|
413
|
+
// 基础数据源
|
|
414
|
+
export const baseTabs = [
|
|
415
|
+
{
|
|
416
|
+
text: 'Tab 1',
|
|
417
|
+
value: '01'
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
text: 'Tab 2',
|
|
421
|
+
value: '02'
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
text: 'Tab 3',
|
|
425
|
+
value: '03'
|
|
426
|
+
}
|
|
427
|
+
]
|
|
428
|
+
// 徽标提示 selected value
|
|
429
|
+
const logoTipsSelectedValue = ref('')
|
|
430
|
+
//徽标提示
|
|
431
|
+
const logoTipsItemOptions = (item: Record<string, any>, index: number) => {
|
|
432
|
+
if (index === 0) {
|
|
433
|
+
return {
|
|
434
|
+
doit: true
|
|
435
|
+
}
|
|
436
|
+
} else if (index === 1) {
|
|
437
|
+
return {
|
|
438
|
+
num: 11
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
return null
|
|
442
|
+
}
|
|
443
|
+
</script>
|
|
444
|
+
```
|
|
445
|
+
### 竖向排列
|
|
446
|
+
```html
|
|
447
|
+
<h2>竖向排列</h2>
|
|
448
|
+
<fox-tabs-bar
|
|
449
|
+
v-model="verticalSelectedValue"
|
|
450
|
+
:data="baseTabs"
|
|
451
|
+
direction="vertical"
|
|
452
|
+
style="height: 120px"
|
|
453
|
+
></fox-tabs-bar>
|
|
454
|
+
<h2>可滚动(竖向)</h2>
|
|
455
|
+
<fox-tabs-bar
|
|
456
|
+
v-model="verticalMoreSelectedValue"
|
|
457
|
+
:data="moreTabs"
|
|
458
|
+
direction="vertical"
|
|
459
|
+
:scroll="true"
|
|
460
|
+
gutter="1rem"
|
|
461
|
+
style="height: 200px"
|
|
462
|
+
></fox-tabs-bar>
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
### 可拖拽
|
|
466
|
+
在组件`fox-tabs-container`中设置`draggle`属性,可开启拖拽支持
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
```html
|
|
470
|
+
<template>
|
|
471
|
+
<h2>可以拖拽</h2>
|
|
472
|
+
<fox-tabs-bar v-model="draggleSelectedValue" :data="baseTabs"></fox-tabs-bar>
|
|
473
|
+
<fox-tabs-container v-model="draggleSelectedValue" :draggle="true">
|
|
474
|
+
<fox-tabs-pane v-for="(tab, index) in baseTabs" :pane-key="tab.value" :key="tab.value">
|
|
475
|
+
<div style="text-align: center; padding: 30px">{{ tab.text }}</div>
|
|
476
|
+
</fox-tabs-pane>
|
|
477
|
+
</fox-tabs-container>
|
|
478
|
+
</template>
|
|
479
|
+
|
|
480
|
+
<script lang="ts" setup>
|
|
481
|
+
// 基础数据源
|
|
482
|
+
const baseTabs = [
|
|
483
|
+
{
|
|
484
|
+
text: 'Tab 1',
|
|
485
|
+
value: '01'
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
text: 'Tab 2',
|
|
489
|
+
value: '02'
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
text: 'Tab 3',
|
|
493
|
+
value: '03'
|
|
494
|
+
}
|
|
495
|
+
]
|
|
496
|
+
// draggle selected value
|
|
497
|
+
const draggleSelectedValue = ref('01')
|
|
498
|
+
</script>
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
### 简易用法
|
|
503
|
+
|
|
504
|
+
在组件`fox-tabs-frame`提供了`fox-tabs-bar`和`fox-tabs-container`的简易用法
|
|
505
|
+
|
|
506
|
+
```html
|
|
507
|
+
<template>
|
|
508
|
+
<h2 style="margin: 10px 0px">基本用法(tab水平排列)</h2>
|
|
509
|
+
<fox-tabs-frame v-model="activeName" align="left">
|
|
510
|
+
<fox-tabs-pane label="User" pane-key="first">User</fox-tabs-pane>
|
|
511
|
+
<fox-tabs-pane label="Config" pane-key="second">Config</fox-tabs-pane>
|
|
512
|
+
<fox-tabs-pane label="Role" pane-key="third">Role</fox-tabs-pane>
|
|
513
|
+
<fox-tabs-pane label="Task" pane-key="fourth">Task</fox-tabs-pane>
|
|
514
|
+
</fox-tabs-frame>
|
|
515
|
+
|
|
516
|
+
<h2 style="margin: 10px 0px">基本用法(tab竖向排列)</h2>
|
|
517
|
+
<fox-tabs-frame v-model="activeName" align="left" direction="vertical" height="250px">
|
|
518
|
+
<fox-tabs-pane label="User" pane-key="first">User</fox-tabs-pane>
|
|
519
|
+
<fox-tabs-pane label="Config" pane-key="second">Config</fox-tabs-pane>
|
|
520
|
+
<fox-tabs-pane label="Role" pane-key="third">Role</fox-tabs-pane>
|
|
521
|
+
<fox-tabs-pane label="Task" pane-key="fourth">Task</fox-tabs-pane>
|
|
522
|
+
</fox-tabs-frame>
|
|
523
|
+
</template>
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
## 4. 相关组件 (Related Components)
|
|
527
|
+
- **fox-js**: 与 TabsBar 配合使用的相关组件
|
|
528
|
+
- **fox-tabs-container**: 与 TabsBar 配合使用的相关组件
|
|
529
|
+
- **fox-tabs-pane**: 与 TabsBar 配合使用的相关组件
|
|
530
|
+
- **fox-tabs-frame**: 与 TabsBar 配合使用的相关组件
|
|
531
|
+
- **fox-tabs**: 与 TabsBar 配合使用的相关组件
|
|
532
|
+
- **fox-tabpane**: 与 TabsBar 配合使用的相关组件
|
|
533
|
+
|