@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,273 @@
|
|
|
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: Layout 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 简便地创建布局
|
|
12
|
+
tags: [foxui, fox-layout, FoxLayout]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js","fox-row","fox-col"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Layout 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
Layout 是 foxui 中用于 **简便地创建布局** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-layout` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
23
|
+
- **核心增强**: 基于 NutUI 组件二次封装、适配 H5 与小程序多端
|
|
24
|
+
- **适用场景**: 简便地创建布局
|
|
25
|
+
|
|
26
|
+
> 💡 **关键原则**: 在所有 简便地创建布局 中,**必须**优先使用此组件,禁止直接使用原生 NutUI 组件。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. 关键 API 说明 (Key API)
|
|
31
|
+
|
|
32
|
+
### 2.1 Props 属性
|
|
33
|
+
|
|
34
|
+
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|
|
35
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
36
|
+
| `type` | 布局方式,可选值为flex | String | - |
|
|
37
|
+
| `gutter` | 列元素之间的间距(单位为px) | String、Number | - |
|
|
38
|
+
| `justify` | Flex 主轴对齐方式,可选值为 start end center space-around space-between space-evenly | String | start |
|
|
39
|
+
| `align` | Flex 交叉轴对齐方式,可选值为 flex-start center flex-end | String | flex-start |
|
|
40
|
+
| `wrap` | Flex是否换行,可选值为 nowrap wrap reverse | String | nowrap |
|
|
41
|
+
| `span` | 列元素宽度(共分为24份,例如设置一行3个,那么span值为8) | String、Number | 24 |
|
|
42
|
+
| `offset` | 列元素偏移距离 | String、Number | 0 |
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### 2.2 Events 事件
|
|
46
|
+
|
|
47
|
+
| 事件名 | 类型 | 说明 |
|
|
48
|
+
| :--- | :--- | :--- |
|
|
49
|
+
| `click` | 点击时触发 | event: MouseEvent |
|
|
50
|
+
|
|
51
|
+
### 2.3 Methods 方法
|
|
52
|
+
|
|
53
|
+
| 方法名 | 参数 | 说明 |
|
|
54
|
+
| :--- | :--- | :--- |
|
|
55
|
+
无
|
|
56
|
+
|
|
57
|
+
### 2.4 Slots 插槽
|
|
58
|
+
|
|
59
|
+
| 插槽名 | 说明 |
|
|
60
|
+
| :--- | :--- |
|
|
61
|
+
无
|
|
62
|
+
|
|
63
|
+
## 3. 例子 (Examples)
|
|
64
|
+
|
|
65
|
+
## 代码演示
|
|
66
|
+
|
|
67
|
+
### 基础用法
|
|
68
|
+
|
|
69
|
+
```html
|
|
70
|
+
<template>
|
|
71
|
+
<fox-row>
|
|
72
|
+
<fox-col :span="24">
|
|
73
|
+
<div class="flex-content">span:24</div>
|
|
74
|
+
</fox-col>
|
|
75
|
+
</fox-row>
|
|
76
|
+
<fox-row>
|
|
77
|
+
<fox-col :span="12">
|
|
78
|
+
<div class="flex-content">span:12</div>
|
|
79
|
+
</fox-col>
|
|
80
|
+
<fox-col :span="12">
|
|
81
|
+
<div class="flex-content flex-content-light">span:12</div>
|
|
82
|
+
</fox-col>
|
|
83
|
+
</fox-row>
|
|
84
|
+
<fox-row>
|
|
85
|
+
<fox-col :span="8">
|
|
86
|
+
<div class="flex-content">span:8</div>
|
|
87
|
+
</fox-col>
|
|
88
|
+
<fox-col :span="8">
|
|
89
|
+
<div class="flex-content flex-content-light">span:8</div>
|
|
90
|
+
</fox-col>
|
|
91
|
+
<fox-col :span="8">
|
|
92
|
+
<div class="flex-content">span:8</div>
|
|
93
|
+
</fox-col>
|
|
94
|
+
</fox-row>
|
|
95
|
+
<fox-row>
|
|
96
|
+
<fox-col :span="6">
|
|
97
|
+
<div class="flex-content">span:6</div>
|
|
98
|
+
</fox-col>
|
|
99
|
+
<fox-col :span="6">
|
|
100
|
+
<div class="flex-content flex-content-light">span:6</div>
|
|
101
|
+
</fox-col>
|
|
102
|
+
<fox-col :span="6">
|
|
103
|
+
<div class="flex-content">span:6</div>
|
|
104
|
+
</fox-col>
|
|
105
|
+
<fox-col :span="6">
|
|
106
|
+
<div class="flex-content">span:6</div>
|
|
107
|
+
</fox-col>
|
|
108
|
+
</fox-row>
|
|
109
|
+
</template>
|
|
110
|
+
<style lang="scss" scoped>
|
|
111
|
+
.fox-row {
|
|
112
|
+
overflow: hidden;
|
|
113
|
+
&:not(:last-child) .fox-col {
|
|
114
|
+
margin-bottom: 15px;
|
|
115
|
+
}
|
|
116
|
+
margin-bottom: 15px;
|
|
117
|
+
}
|
|
118
|
+
.flex-content {
|
|
119
|
+
line-height: 40px;
|
|
120
|
+
color: #fff;
|
|
121
|
+
text-align: center;
|
|
122
|
+
border-radius: 6px;
|
|
123
|
+
background: #ff8881;
|
|
124
|
+
&.flex-content-light {
|
|
125
|
+
background: #ffc7c4;
|
|
126
|
+
}
|
|
127
|
+
&.flex-content-height {
|
|
128
|
+
height: 50px;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
</style>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 设置元素间距
|
|
135
|
+
|
|
136
|
+
```html
|
|
137
|
+
<template>
|
|
138
|
+
<fox-row :gutter="10">
|
|
139
|
+
<fox-col :span="8">
|
|
140
|
+
<div class="flex-content">span:8</div>
|
|
141
|
+
</fox-col>
|
|
142
|
+
<fox-col :span="8">
|
|
143
|
+
<div class="flex-content flex-content-light">span:8</div>
|
|
144
|
+
</fox-col>
|
|
145
|
+
<fox-col :span="8">
|
|
146
|
+
<div class="flex-content">span:8</div>
|
|
147
|
+
</fox-col>
|
|
148
|
+
</fox-row>
|
|
149
|
+
</template>
|
|
150
|
+
<style lang="scss" scoped>
|
|
151
|
+
.fox-row {
|
|
152
|
+
overflow: hidden;
|
|
153
|
+
&:not(:last-child) .fox-col {
|
|
154
|
+
margin-bottom: 15px;
|
|
155
|
+
}
|
|
156
|
+
margin-bottom: 15px;
|
|
157
|
+
}
|
|
158
|
+
.flex-content {
|
|
159
|
+
line-height: 40px;
|
|
160
|
+
color: #fff;
|
|
161
|
+
text-align: center;
|
|
162
|
+
border-radius: 6px;
|
|
163
|
+
background: #ff8881;
|
|
164
|
+
&.flex-content-light {
|
|
165
|
+
background: #ffc7c4;
|
|
166
|
+
}
|
|
167
|
+
&.flex-content-height {
|
|
168
|
+
height: 50px;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
</style>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Flex布局
|
|
175
|
+
|
|
176
|
+
```html
|
|
177
|
+
<template>
|
|
178
|
+
<fox-row type="flex" wrap="nowrap">
|
|
179
|
+
<fox-col :span="6">
|
|
180
|
+
<div class="flex-content">span:6</div>
|
|
181
|
+
</fox-col>
|
|
182
|
+
<fox-col :span="6">
|
|
183
|
+
<div class="flex-content flex-content-light">span:6</div>
|
|
184
|
+
</fox-col>
|
|
185
|
+
<fox-col :span="6">
|
|
186
|
+
<div class="flex-content">span:6</div>
|
|
187
|
+
</fox-col>
|
|
188
|
+
</fox-row>
|
|
189
|
+
<fox-row type="flex" justify="center">
|
|
190
|
+
<fox-col :span="6">
|
|
191
|
+
<div class="flex-content">span:6</div>
|
|
192
|
+
</fox-col>
|
|
193
|
+
<fox-col :span="6">
|
|
194
|
+
<div class="flex-content flex-content-light">span:6</div>
|
|
195
|
+
</fox-col>
|
|
196
|
+
<fox-col :span="6">
|
|
197
|
+
<div class="flex-content">span:6</div>
|
|
198
|
+
</fox-col>
|
|
199
|
+
</fox-row>
|
|
200
|
+
<fox-row type="flex" justify="end">
|
|
201
|
+
<fox-col :span="6">
|
|
202
|
+
<div class="flex-content">span:6</div>
|
|
203
|
+
</fox-col>
|
|
204
|
+
<fox-col :span="6">
|
|
205
|
+
<div class="flex-content flex-content-light">span:6</div>
|
|
206
|
+
</fox-col>
|
|
207
|
+
<fox-col :span="6">
|
|
208
|
+
<div class="flex-content">span:6</div>
|
|
209
|
+
</fox-col>
|
|
210
|
+
</fox-row>
|
|
211
|
+
<fox-row type="flex" justify="space-between">
|
|
212
|
+
<fox-col :span="6">
|
|
213
|
+
<div class="flex-content">span:6</div>
|
|
214
|
+
</fox-col>
|
|
215
|
+
<fox-col :span="6">
|
|
216
|
+
<div class="flex-content flex-content-light">span:6</div>
|
|
217
|
+
</fox-col>
|
|
218
|
+
<fox-col :span="6">
|
|
219
|
+
<div class="flex-content">span:6</div>
|
|
220
|
+
</fox-col>
|
|
221
|
+
</fox-row>
|
|
222
|
+
<fox-row type="flex" justify="space-around">
|
|
223
|
+
<fox-col :span="6">
|
|
224
|
+
<div class="flex-content">span:6</div>
|
|
225
|
+
</fox-col>
|
|
226
|
+
<fox-col :span="6">
|
|
227
|
+
<div class="flex-content flex-content-light">span:6</div>
|
|
228
|
+
</fox-col>
|
|
229
|
+
<fox-col :span="6">
|
|
230
|
+
<div class="flex-content">span:6</div>
|
|
231
|
+
</fox-col>
|
|
232
|
+
</fox-row>
|
|
233
|
+
<fox-row type="flex" justify="space-evenly">
|
|
234
|
+
<fox-col :span="6">
|
|
235
|
+
<div class="flex-content">span:6</div>
|
|
236
|
+
</fox-col>
|
|
237
|
+
<fox-col :span="6">
|
|
238
|
+
<div class="flex-content flex-content-light">span:6</div>
|
|
239
|
+
</fox-col>
|
|
240
|
+
<fox-col :span="6">
|
|
241
|
+
<div class="flex-content">span:6</div>
|
|
242
|
+
</fox-col>
|
|
243
|
+
</fox-row>
|
|
244
|
+
</template>
|
|
245
|
+
<style lang="scss" scoped>
|
|
246
|
+
.fox-row {
|
|
247
|
+
overflow: hidden;
|
|
248
|
+
&:not(:last-child) .fox-col {
|
|
249
|
+
margin-bottom: 15px;
|
|
250
|
+
}
|
|
251
|
+
margin-bottom: 15px;
|
|
252
|
+
}
|
|
253
|
+
.flex-content {
|
|
254
|
+
line-height: 40px;
|
|
255
|
+
color: #fff;
|
|
256
|
+
text-align: center;
|
|
257
|
+
border-radius: 6px;
|
|
258
|
+
background: #ff8881;
|
|
259
|
+
&.flex-content-light {
|
|
260
|
+
background: #ffc7c4;
|
|
261
|
+
}
|
|
262
|
+
&.flex-content-height {
|
|
263
|
+
height: 50px;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
</style>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## 4. 相关组件 (Related Components)
|
|
270
|
+
- **fox-js**: 与 Layout 配合使用的相关组件
|
|
271
|
+
- **fox-row**: 与 Layout 配合使用的相关组件
|
|
272
|
+
- **fox-col**: 与 Layout 配合使用的相关组件
|
|
273
|
+
|
|
@@ -0,0 +1,158 @@
|
|
|
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: LinkItem 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 打开链接
|
|
12
|
+
tags: [foxui, fox-link-item, FoxLinkItem]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js","fox-group","fox-actionsheet"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# LinkItem 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
LinkItem 是 foxui 中用于 **打开链接** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-link-item` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
23
|
+
- **核心增强**: 基于 NutUI 组件二次封装、内置必填校验标识、支持 v-model 双向绑定、支持标签位置自定义、支持占位符提示、支持禁用/只读状态、内置多级提示信息、支持插槽扩展自定义内容、支持主题定制
|
|
24
|
+
- **适用场景**: 打开链接
|
|
25
|
+
|
|
26
|
+
> 💡 **关键原则**: 在所有 打开链接 中,**必须**优先使用此组件,禁止直接使用原生 NutUI 组件。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. 关键 API 说明 (Key API)
|
|
31
|
+
|
|
32
|
+
### 2.1 Props 属性
|
|
33
|
+
|
|
34
|
+
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|
|
35
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
36
|
+
| `v-model` | 输入值,双向绑定 | String | - |
|
|
37
|
+
| `placeholder` | 为空时占位符 | String | - |
|
|
38
|
+
| `text-align` | 文本位置,可选值left,center,right | String | left |
|
|
39
|
+
| `label` | 标签 | String | - |
|
|
40
|
+
| `label-width` | 标签宽度 | String | - |
|
|
41
|
+
| `label-position` | 标签位置可选值left,right,top | String | - |
|
|
42
|
+
| `is-required` | 左侧号是否展示 | Boolean | false |
|
|
43
|
+
| `disabled` | 是否禁用 | Boolean | false |
|
|
44
|
+
| `readonly` | 是否只读 | Boolean | false |
|
|
45
|
+
| `error-tip` | 错误提示 | String | - |
|
|
46
|
+
| `error-icon` | 错误提示图标 | Component | - |
|
|
47
|
+
| `error-class` | 错误提示class | String | - |
|
|
48
|
+
| `warn-tip` | 警告提示 | String | - |
|
|
49
|
+
| `wran-icon` | 警告提示图标 | Component | - |
|
|
50
|
+
| `wran-class` | 警告提示class | String | - |
|
|
51
|
+
| `info-tip` | 提示 | String | - |
|
|
52
|
+
| `info-icon` | 提示图标 | Component | - |
|
|
53
|
+
| `info-class` | 提示class | String | - |
|
|
54
|
+
|
|
55
|
+
### 2.2 Events 事件
|
|
56
|
+
|
|
57
|
+
| 事件名 | 类型 | 说明 |
|
|
58
|
+
| :--- | :--- | :--- |
|
|
59
|
+
| `click` | 点击触发 | val |
|
|
60
|
+
| `focus` | 聚焦时触发 | val |
|
|
61
|
+
| `blur` | 失焦时触发 | val |
|
|
62
|
+
| `clear` | 点击清空时触发 | val |
|
|
63
|
+
|
|
64
|
+
### 2.3 Methods 方法
|
|
65
|
+
|
|
66
|
+
| 方法名 | 参数 | 说明 |
|
|
67
|
+
| :--- | :--- | :--- |
|
|
68
|
+
无
|
|
69
|
+
|
|
70
|
+
### 2.4 Slots 插槽
|
|
71
|
+
|
|
72
|
+
| 插槽名 | 说明 |
|
|
73
|
+
| :--- | :--- |
|
|
74
|
+
| `default` | label内容 |
|
|
75
|
+
| `prepend` | 左侧自定义内容 |
|
|
76
|
+
| `append` | 右侧自定义内容 |
|
|
77
|
+
| `content` | 内容区内容 |
|
|
78
|
+
|
|
79
|
+
## 3. 例子 (Examples)
|
|
80
|
+
|
|
81
|
+
## 代码演示
|
|
82
|
+
### 基础用法
|
|
83
|
+
常用属性与事件
|
|
84
|
+
```html
|
|
85
|
+
<template>
|
|
86
|
+
<fox-group title="基础用法">
|
|
87
|
+
<fox-link-item
|
|
88
|
+
v-model="val"
|
|
89
|
+
:info-tip="msg"
|
|
90
|
+
@focus="onFocus"
|
|
91
|
+
@blur="onBlur"
|
|
92
|
+
@click="onClick"
|
|
93
|
+
>普通</fox-link-item
|
|
94
|
+
>
|
|
95
|
+
<fox-link-item v-model="val" disabled @focus="onFocus" @blur="onBlur" @click="onClick">禁用</fox-link-item>
|
|
96
|
+
<fox-link-item v-model="val2" required @focus="onFocus" @blur="onBlur">必输</fox-link-item>
|
|
97
|
+
</fox-group>
|
|
98
|
+
<fox-actionsheet
|
|
99
|
+
v-model:visible="visible"
|
|
100
|
+
cancel-text="取消"
|
|
101
|
+
description="银行列表"
|
|
102
|
+
:menu-items="m_menuItems"
|
|
103
|
+
@choose="chooseItem"
|
|
104
|
+
>
|
|
105
|
+
</fox-actionsheet>
|
|
106
|
+
</template>
|
|
107
|
+
```
|
|
108
|
+
```javascript
|
|
109
|
+
<script lang="ts">
|
|
110
|
+
import { reactive, toRefs } from 'vue'
|
|
111
|
+
import { createComponent } from '@/utils/create'
|
|
112
|
+
const { createDemo } = createComponent('link-item')
|
|
113
|
+
const banks = [
|
|
114
|
+
{ name: '耀光帝国商业银行', subname: '账号:0021234021' },
|
|
115
|
+
{ name: '蛮血部落联合银行', subname: '账号:0021234022' },
|
|
116
|
+
{ name: '绿裔联盟农业发展银行', subname: '账号:0021234023' },
|
|
117
|
+
{ name: '亡灵帝国银行', subname: '账号:0021234024' }
|
|
118
|
+
]
|
|
119
|
+
export default createDemo({
|
|
120
|
+
// setup
|
|
121
|
+
setup() {
|
|
122
|
+
// 数据
|
|
123
|
+
const data = reactive({
|
|
124
|
+
m_menuItems: banks,
|
|
125
|
+
visible: false,
|
|
126
|
+
val: banks[0].name,
|
|
127
|
+
msg: banks[0].subname,
|
|
128
|
+
val2: ''
|
|
129
|
+
})
|
|
130
|
+
// 方法
|
|
131
|
+
const methods = {
|
|
132
|
+
chooseItem(itemParams: any) {
|
|
133
|
+
data.val = itemParams.name
|
|
134
|
+
},
|
|
135
|
+
onFocus: (value: string | number) => {
|
|
136
|
+
console.log('focus:', value)
|
|
137
|
+
},
|
|
138
|
+
onBlur: (value: string | number) => {
|
|
139
|
+
console.log('blur:', value, event)
|
|
140
|
+
},
|
|
141
|
+
onClick: () => {
|
|
142
|
+
data.visible = true
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
...toRefs(data),
|
|
147
|
+
...methods
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
})
|
|
151
|
+
</script>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## 4. 相关组件 (Related Components)
|
|
155
|
+
- **fox-js**: 与 LinkItem 配合使用的相关组件
|
|
156
|
+
- **fox-group**: 与 LinkItem 配合使用的相关组件
|
|
157
|
+
- **fox-actionsheet**: 与 LinkItem 配合使用的相关组件
|
|
158
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
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: List 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 可在成千上万条数据渲染时只渲染用户最大可见条数,提升页面渲染性能
|
|
12
|
+
tags: [foxui, fox-list, FoxList]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js","fox-cell","fox-list-item"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# List 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
List 是 foxui 中用于 **可在成千上万条数据渲染时只渲染用户最大可见条数,提升页面渲染性能** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-list` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
23
|
+
- **核心增强**: 基于 NutUI 组件二次封装、支持插槽扩展自定义内容
|
|
24
|
+
- **适用场景**: 可在成千上万条数据渲染时只渲染用户最大可见条数,提升页面渲染性能
|
|
25
|
+
|
|
26
|
+
> 💡 **关键原则**: 在所有 可在成千上万条数据渲染时只渲染用户最大可见条数,提升页面渲染性能 中,**必须**优先使用此组件,禁止直接使用原生 NutUI 组件。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. 关键 API 说明 (Key API)
|
|
31
|
+
|
|
32
|
+
### 2.1 Props 属性
|
|
33
|
+
|
|
34
|
+
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|
|
35
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
36
|
+
| `height` | 列表项的高度/预估高度,支持不固定高度 | Number | 80 |
|
|
37
|
+
| `list-data` | 列表数据 | any | |
|
|
38
|
+
| `container-height` | 容器高度最大值不能超过可视区 | Number | 可视区高度 |
|
|
39
|
+
| `buffer-size` | 数据缓冲区长度 | Number | 5 |
|
|
40
|
+
| `margin` | 列表之间的间隙,和自定义样式保持一致 | Number | 10 |
|
|
41
|
+
|
|
42
|
+
### 2.2 Events 事件
|
|
43
|
+
|
|
44
|
+
| 事件名 | 类型 | 说明 |
|
|
45
|
+
| :--- | :--- | :--- |
|
|
46
|
+
| `scroll-bottom` | 滚动到底部时触发 | - |
|
|
47
|
+
| `scroll-up` | 向上滚动 | - |
|
|
48
|
+
| `scroll-down` | 向下滚动 | - |
|
|
49
|
+
|
|
50
|
+
### 2.3 Methods 方法
|
|
51
|
+
|
|
52
|
+
| 方法名 | 参数 | 说明 |
|
|
53
|
+
| :--- | :--- | :--- |
|
|
54
|
+
无
|
|
55
|
+
|
|
56
|
+
### 2.4 Slots 插槽
|
|
57
|
+
|
|
58
|
+
| 插槽名 | 说明 |
|
|
59
|
+
| :--- | :--- |
|
|
60
|
+
| `item` | 列表项数据 |
|
|
61
|
+
| `index` | 列表索引 |
|
|
62
|
+
|
|
63
|
+
## 3. 例子 (Examples)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## 4. 相关组件 (Related Components)
|
|
68
|
+
- **fox-js**: 与 List 配合使用的相关组件
|
|
69
|
+
- **fox-cell**: 与 List 配合使用的相关组件
|
|
70
|
+
- **fox-list-item**: 与 List 配合使用的相关组件
|
|
71
|
+
|