@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,499 @@
|
|
|
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: ActionsheetItem 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 动作面板输入框
|
|
12
|
+
tags: [foxui, fox-actionsheet-item, FoxActionsheetItem]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js","fox-group","fox-actionsheet-pane"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# ActionsheetItem 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
ActionsheetItem 是 foxui 中用于 **动作面板输入框** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-actionsheet-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
|
+
| `source` | 数据源 | Array,Function,String | - |
|
|
37
|
+
| `visible` | 是否可见 | boolean | false |
|
|
38
|
+
| `value-type` | 值的类型text:item.text,value:item.value,item:item | String | "value" |
|
|
39
|
+
| `text-key` | 指定异构数据源的text key | String | "text" |
|
|
40
|
+
| `sub-text-key` | 指定异构数据源的subtext key | String | "subText" |
|
|
41
|
+
| `value-key` | 指定异构数据源的value key | String | "value" |
|
|
42
|
+
| `disabled-key` | 指定异构数据源的disabled key | String | "disabled" |
|
|
43
|
+
| `item-options` | option样式设置 | ItemOption | - |
|
|
44
|
+
| `icon` | option icon | Component | - |
|
|
45
|
+
| `checked-icon` | option checked icon | Component | - |
|
|
46
|
+
| `icon-size` | option icon sze | Number | - |
|
|
47
|
+
| `page-size` | 加载列表的大小 | Number | 10 |
|
|
48
|
+
| `options-height` | 列表高度 | String | - |
|
|
49
|
+
| `multiple` | 是否多选 | Boolean | false |
|
|
50
|
+
| `visible` | 是否可见 | Boolean | false |
|
|
51
|
+
| `close-on-click-overlay` | 点击overlay关闭 | Boolean | true |
|
|
52
|
+
| `title` | 设置标题 | String | - |
|
|
53
|
+
| `confirm-text` | 确定按钮文案 | String | 确定 |
|
|
54
|
+
| `load-text` | 加载数据提示 | String | 加载中 |
|
|
55
|
+
| `load-more-text` | 无更多数据提交 | String | 无更多数据 |
|
|
56
|
+
| `is-auto-back-fill` | 是否自定回填 | Boolean | 是否点击回填单选 |
|
|
57
|
+
| `show-searchbar` | 是否显示查询栏 | Boolean | 是否显示查询栏 |
|
|
58
|
+
| `search-key` | 查询输入框字段 | String | keyword |
|
|
59
|
+
| `seach-placeholder` | 查询输入框placeholder | String | - |
|
|
60
|
+
| `search-delay-trigger-clear` | 查询输入框延时触发clear动作 | number | 250 |
|
|
61
|
+
| `before-close` | 关闭前拦截函数返回false阻止动作面板关闭 | BeforeClose | - |
|
|
62
|
+
|
|
63
|
+
### 2.2 Events 事件
|
|
64
|
+
|
|
65
|
+
| 事件名 | 类型 | 说明 |
|
|
66
|
+
| :--- | :--- | :--- |
|
|
67
|
+
| `change` | 输入内容时触发 | val, item |
|
|
68
|
+
| `focus` | 聚焦时触发 | val |
|
|
69
|
+
| `blur` | 失焦时触发 | val |
|
|
70
|
+
| `clear` | 点击清空时触发 | val |
|
|
71
|
+
|
|
72
|
+
### 2.3 Methods 方法
|
|
73
|
+
|
|
74
|
+
| 方法名 | 参数 | 说明 |
|
|
75
|
+
| :--- | :--- | :--- |
|
|
76
|
+
| `search` | 触发查询动作 | params |
|
|
77
|
+
| `clear` | 触发清空动作 | - |
|
|
78
|
+
| `confirm` | 触发确认动作 | - |
|
|
79
|
+
| `cancel` | 触发取消动作 | - |
|
|
80
|
+
|
|
81
|
+
### 2.4 Slots 插槽
|
|
82
|
+
|
|
83
|
+
| 插槽名 | 说明 |
|
|
84
|
+
| :--- | :--- |
|
|
85
|
+
| `title` | ActionSheet标题内容 |
|
|
86
|
+
| `search` | ActionSheet查询栏内容 |
|
|
87
|
+
| `option` | ActionSheet列表option内容 |
|
|
88
|
+
| `optionLabel` | ActionSheet列表option内容 |
|
|
89
|
+
| `optionIcon` | ActionSheet列表Icon内容 |
|
|
90
|
+
| `buttons` | ActionSheet底部按钮 |
|
|
91
|
+
|
|
92
|
+
## 3. 例子 (Examples)
|
|
93
|
+
|
|
94
|
+
## 代码演示
|
|
95
|
+
|
|
96
|
+
### 基础用法
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<fox-group title="基础用法" label-width="120px">
|
|
101
|
+
<fox-actionsheet-item v-model="data.val" :source="sourceForArray" title="天下五绝">基础 </fox-actionsheet-item>
|
|
102
|
+
<fox-actionsheet-item v-model="data.val2" :source="sourceForArray" title="天下五绝" disabled
|
|
103
|
+
>禁用
|
|
104
|
+
</fox-actionsheet-item>
|
|
105
|
+
</fox-group>
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
import { reactive, ref, watch } from 'vue'
|
|
111
|
+
|
|
112
|
+
// 本地数据源
|
|
113
|
+
const sourceForArray = ref([
|
|
114
|
+
{
|
|
115
|
+
text: '黄老邪',
|
|
116
|
+
subText: '天下五绝:东邪,桃花岛主',
|
|
117
|
+
value: '01'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
text: '欧阳锋',
|
|
121
|
+
subText: '天下五绝:西毒,西域白驼山庄庄主',
|
|
122
|
+
value: '02'
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
text: '一灯大师',
|
|
126
|
+
subText: '天下五绝:南帝,大理段氏“一阳指”自成一派',
|
|
127
|
+
value: '03'
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
text: '洪七公',
|
|
131
|
+
subText: '天下五绝:北丐,丐帮帮主',
|
|
132
|
+
value: '04'
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
text: '王重阳',
|
|
136
|
+
subText: '天下五绝:中神通,全真派创始祖师',
|
|
137
|
+
value: '05'
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
text: '郭靖',
|
|
141
|
+
subText: '他用一生来践行“侠之大者,为国为民”的精神',
|
|
142
|
+
value: '06'
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
text: '黄蓉',
|
|
146
|
+
subText: '集天地灵气于一身,艳绝天下、冰雪聪明、玲珑剔透、多才多艺、博古通今',
|
|
147
|
+
value: '07'
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
text: '江南七怪',
|
|
151
|
+
subText: '江南七怪是郭靖最重要的启蒙师父,还是郭靖成为“侠之大者”的引路者',
|
|
152
|
+
value: '08'
|
|
153
|
+
}
|
|
154
|
+
])
|
|
155
|
+
|
|
156
|
+
// 数据
|
|
157
|
+
const data = reactive({
|
|
158
|
+
val: '03',
|
|
159
|
+
val2: '02'
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 多选
|
|
165
|
+
|
|
166
|
+
通过属性`multiple`设置多选
|
|
167
|
+
|
|
168
|
+
```html
|
|
169
|
+
<fox-group title="多选" label-width="100px">
|
|
170
|
+
<fox-actionsheet-item v-model="data.val3" :source="sourceForArray" title="天下五绝" multiple
|
|
171
|
+
>多选
|
|
172
|
+
</fox-actionsheet-item>
|
|
173
|
+
<fox-actionsheet-item v-model="data.val4" :source="sourceForArray" title="多选" multiple
|
|
174
|
+
>多选(预选)
|
|
175
|
+
</fox-actionsheet-item>
|
|
176
|
+
</fox-group>
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
import { reactive, ref, watch } from 'vue'
|
|
182
|
+
|
|
183
|
+
// 本地数据源
|
|
184
|
+
const sourceForArray = ref([
|
|
185
|
+
{
|
|
186
|
+
text: '黄老邪',
|
|
187
|
+
subText: '天下五绝:东邪,桃花岛主',
|
|
188
|
+
value: '01'
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
text: '欧阳锋',
|
|
192
|
+
subText: '天下五绝:西毒,西域白驼山庄庄主',
|
|
193
|
+
value: '02'
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
text: '一灯大师',
|
|
197
|
+
subText: '天下五绝:南帝,大理段氏“一阳指”自成一派',
|
|
198
|
+
value: '03'
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
text: '洪七公',
|
|
202
|
+
subText: '天下五绝:北丐,丐帮帮主',
|
|
203
|
+
value: '04'
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
text: '王重阳',
|
|
207
|
+
subText: '天下五绝:中神通,全真派创始祖师',
|
|
208
|
+
value: '05'
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
text: '郭靖',
|
|
212
|
+
subText: '他用一生来践行“侠之大者,为国为民”的精神',
|
|
213
|
+
value: '06'
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
text: '黄蓉',
|
|
217
|
+
subText: '集天地灵气于一身,艳绝天下、冰雪聪明、玲珑剔透、多才多艺、博古通今',
|
|
218
|
+
value: '07'
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
text: '江南七怪',
|
|
222
|
+
subText: '江南七怪是郭靖最重要的启蒙师父,还是郭靖成为“侠之大者”的引路者',
|
|
223
|
+
value: '08'
|
|
224
|
+
}
|
|
225
|
+
])
|
|
226
|
+
|
|
227
|
+
// 数据
|
|
228
|
+
const data = reactive({
|
|
229
|
+
val3: '',
|
|
230
|
+
val4: ['01', '03']
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### 自动回填(单选)
|
|
236
|
+
|
|
237
|
+
通过属性`is-auto-back-fill`设置点击后自动回填,要求必须为单选模式
|
|
238
|
+
|
|
239
|
+
```html
|
|
240
|
+
<fox-group title="自动回填(单选)" label-width="100px">
|
|
241
|
+
<fox-actionsheet-item v-model="data.val5" :source="sourceForArray" title="自动回填(单选)" :is-auto-back-fill="true"
|
|
242
|
+
>回填
|
|
243
|
+
</fox-actionsheet-item>
|
|
244
|
+
</fox-group>
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
```ts
|
|
249
|
+
import { reactive, ref, watch } from 'vue'
|
|
250
|
+
|
|
251
|
+
// 本地数据源
|
|
252
|
+
const sourceForArray = ref([
|
|
253
|
+
{
|
|
254
|
+
text: '黄老邪',
|
|
255
|
+
subText: '天下五绝:东邪,桃花岛主',
|
|
256
|
+
value: '01'
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
text: '欧阳锋',
|
|
260
|
+
subText: '天下五绝:西毒,西域白驼山庄庄主',
|
|
261
|
+
value: '02'
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
text: '一灯大师',
|
|
265
|
+
subText: '天下五绝:南帝,大理段氏“一阳指”自成一派',
|
|
266
|
+
value: '03'
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
text: '洪七公',
|
|
270
|
+
subText: '天下五绝:北丐,丐帮帮主',
|
|
271
|
+
value: '04'
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
text: '王重阳',
|
|
275
|
+
subText: '天下五绝:中神通,全真派创始祖师',
|
|
276
|
+
value: '05'
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
text: '郭靖',
|
|
280
|
+
subText: '他用一生来践行“侠之大者,为国为民”的精神',
|
|
281
|
+
value: '06'
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
text: '黄蓉',
|
|
285
|
+
subText: '集天地灵气于一身,艳绝天下、冰雪聪明、玲珑剔透、多才多艺、博古通今',
|
|
286
|
+
value: '07'
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
text: '江南七怪',
|
|
290
|
+
subText: '江南七怪是郭靖最重要的启蒙师父,还是郭靖成为“侠之大者”的引路者',
|
|
291
|
+
value: '08'
|
|
292
|
+
}
|
|
293
|
+
])
|
|
294
|
+
|
|
295
|
+
// 数据
|
|
296
|
+
const data = reactive({
|
|
297
|
+
val5: ''
|
|
298
|
+
})
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### 返回类型
|
|
303
|
+
|
|
304
|
+
通过属性value-type设置v-model的数据类型,分别为text,value(默认)和item
|
|
305
|
+
|
|
306
|
+
```html
|
|
307
|
+
<fox-group title="返回类型" label-width="100px">
|
|
308
|
+
<fox-actionsheet-item v-model="data.val6" :source="sourceForArray" title="返回value">value </fox-actionsheet-item>
|
|
309
|
+
<fox-actionsheet-item v-model="data.val7" :source="sourceForArray" title="返回text" value-type="text"
|
|
310
|
+
>text
|
|
311
|
+
</fox-actionsheet-item>
|
|
312
|
+
<fox-actionsheet-item v-model="data.val8" :source="sourceForArray" title="返回item" value-type="item"
|
|
313
|
+
>item
|
|
314
|
+
</fox-actionsheet-item>
|
|
315
|
+
</fox-group>
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
```ts
|
|
319
|
+
import { reactive, ref, watch } from 'vue'
|
|
320
|
+
|
|
321
|
+
// 本地数据源
|
|
322
|
+
const sourceForArray = ref([
|
|
323
|
+
{
|
|
324
|
+
text: '黄老邪',
|
|
325
|
+
subText: '天下五绝:东邪,桃花岛主',
|
|
326
|
+
value: '01'
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
text: '欧阳锋',
|
|
330
|
+
subText: '天下五绝:西毒,西域白驼山庄庄主',
|
|
331
|
+
value: '02'
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
text: '一灯大师',
|
|
335
|
+
subText: '天下五绝:南帝,大理段氏“一阳指”自成一派',
|
|
336
|
+
value: '03'
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
text: '洪七公',
|
|
340
|
+
subText: '天下五绝:北丐,丐帮帮主',
|
|
341
|
+
value: '04'
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
text: '王重阳',
|
|
345
|
+
subText: '天下五绝:中神通,全真派创始祖师',
|
|
346
|
+
value: '05'
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
text: '郭靖',
|
|
350
|
+
subText: '他用一生来践行“侠之大者,为国为民”的精神',
|
|
351
|
+
value: '06'
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
text: '黄蓉',
|
|
355
|
+
subText: '集天地灵气于一身,艳绝天下、冰雪聪明、玲珑剔透、多才多艺、博古通今',
|
|
356
|
+
value: '07'
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
text: '江南七怪',
|
|
360
|
+
subText: '江南七怪是郭靖最重要的启蒙师父,还是郭靖成为“侠之大者”的引路者',
|
|
361
|
+
value: '08'
|
|
362
|
+
}
|
|
363
|
+
])
|
|
364
|
+
|
|
365
|
+
// 数据
|
|
366
|
+
const data = reactive({
|
|
367
|
+
val6: '',
|
|
368
|
+
val7: '',
|
|
369
|
+
val8: {
|
|
370
|
+
text: '王重阳',
|
|
371
|
+
subText: '天下五绝:中神通,全真派创始祖师',
|
|
372
|
+
value: '05'
|
|
373
|
+
}
|
|
374
|
+
})
|
|
375
|
+
|
|
376
|
+
// watch 返回value
|
|
377
|
+
watch(
|
|
378
|
+
() => data.val6,
|
|
379
|
+
val => {
|
|
380
|
+
console.info('返回value:', val)
|
|
381
|
+
}
|
|
382
|
+
)
|
|
383
|
+
// watch 返回text
|
|
384
|
+
watch(
|
|
385
|
+
() => data.val7,
|
|
386
|
+
val => {
|
|
387
|
+
console.info('返回text:', val)
|
|
388
|
+
}
|
|
389
|
+
)
|
|
390
|
+
// watch 返回value
|
|
391
|
+
watch(
|
|
392
|
+
() => data.val8,
|
|
393
|
+
val => {
|
|
394
|
+
console.info('返回item:', val)
|
|
395
|
+
}
|
|
396
|
+
)
|
|
397
|
+
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
### 数据源
|
|
401
|
+
|
|
402
|
+
```html
|
|
403
|
+
|
|
404
|
+
<fox-group title="数据源" label-width="100px">
|
|
405
|
+
<fox-actionsheet-item v-model="data.val9" :source="sourceForArray" title="数组数据源"
|
|
406
|
+
>数组数据源</fox-actionsheet-item
|
|
407
|
+
>
|
|
408
|
+
<fox-actionsheet-item v-model="data.val10" :source="sourceForFunction" title="函数数据源"
|
|
409
|
+
>函数数据源
|
|
410
|
+
</fox-actionsheet-item>
|
|
411
|
+
<fox-actionsheet-item v-model="data.val11" source="/api/metadata/actionsheet" title="API数据源"
|
|
412
|
+
>API数据源
|
|
413
|
+
</fox-actionsheet-item>
|
|
414
|
+
</fox-group>
|
|
415
|
+
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
```ts
|
|
419
|
+
import { reactive, ref, watch } from 'vue'
|
|
420
|
+
import { setAPI } from '@/api/index'
|
|
421
|
+
|
|
422
|
+
// 基础数据源
|
|
423
|
+
const baseData = [
|
|
424
|
+
{
|
|
425
|
+
text: '程序员',
|
|
426
|
+
subText: 'IT民工,996人生',
|
|
427
|
+
value: '01'
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
text: '教师',
|
|
431
|
+
subText: '以教育为生的职业',
|
|
432
|
+
value: '02'
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
text: '医生',
|
|
436
|
+
subText: '挽救生命以治病为业的人',
|
|
437
|
+
value: '03'
|
|
438
|
+
}
|
|
439
|
+
]
|
|
440
|
+
|
|
441
|
+
// 函数数据源
|
|
442
|
+
const sourceForFunction = async (index: number, pageSize: number, params?: any, first?: boolean) => {
|
|
443
|
+
const keyword = (params ?? {}).keyword
|
|
444
|
+
let data = baseData
|
|
445
|
+
if (typeof keyword === 'string' && keyword.length > 0) {
|
|
446
|
+
data = data.filter(item => {
|
|
447
|
+
return item.text.includes(keyword) || item.subText.includes(keyword)
|
|
448
|
+
})
|
|
449
|
+
}
|
|
450
|
+
let startIndex = (index - 1) * pageSize
|
|
451
|
+
let endIndex = startIndex + pageSize
|
|
452
|
+
if (endIndex > data.length) {
|
|
453
|
+
endIndex = data.length
|
|
454
|
+
}
|
|
455
|
+
const list = data.slice(startIndex, endIndex)
|
|
456
|
+
return {
|
|
457
|
+
totalSize: data.length,
|
|
458
|
+
page: list
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// remote api数据源
|
|
463
|
+
const remoteAPI = async (path: string, index: number, pageSize: number, params?: any, first?: boolean) => {
|
|
464
|
+
const keyword = (params ?? {}).keyword
|
|
465
|
+
let data = baseData
|
|
466
|
+
if (typeof keyword === 'string' && keyword.length > 0) {
|
|
467
|
+
data = data.filter(item => {
|
|
468
|
+
return item.text.includes(keyword) || item.subText.includes(keyword)
|
|
469
|
+
})
|
|
470
|
+
}
|
|
471
|
+
let startIndex = (index - 1) * pageSize
|
|
472
|
+
let endIndex = startIndex + pageSize
|
|
473
|
+
if (endIndex > data.length) {
|
|
474
|
+
endIndex = data.length
|
|
475
|
+
}
|
|
476
|
+
const list = data.slice(startIndex, endIndex)
|
|
477
|
+
return {
|
|
478
|
+
totalSize: data.length,
|
|
479
|
+
page: list
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
//模拟测试,设置一个临时的API数据源,实际环境应该访问服务获取
|
|
484
|
+
setAPI('actionsheet', remoteAPI)
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
// 数据
|
|
488
|
+
const data = reactive({
|
|
489
|
+
val9: '',
|
|
490
|
+
val10: '',
|
|
491
|
+
val11: ''
|
|
492
|
+
})
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
## 4. 相关组件 (Related Components)
|
|
496
|
+
- **fox-js**: 与 ActionsheetItem 配合使用的相关组件
|
|
497
|
+
- **fox-group**: 与 ActionsheetItem 配合使用的相关组件
|
|
498
|
+
- **fox-actionsheet-pane**: 与 ActionsheetItem 配合使用的相关组件
|
|
499
|
+
|
|
@@ -0,0 +1,66 @@
|
|
|
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: Animate 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 给页面元素添加动画效果
|
|
12
|
+
tags: [foxui, fox-animate, FoxAnimate]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js","fox-button"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Animate 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
Animate 是 foxui 中用于 **给页面元素添加动画效果** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-animate` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
23
|
+
- **核心增强**: 基于 NutUI 组件二次封装
|
|
24
|
+
- **适用场景**: 给页面元素添加动画效果
|
|
25
|
+
|
|
26
|
+
> 💡 **关键原则**: 在所有 给页面元素添加动画效果 中,**必须**优先使用此组件,禁止直接使用原生 NutUI 组件。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. 关键 API 说明 (Key API)
|
|
31
|
+
|
|
32
|
+
### 2.1 Props 属性
|
|
33
|
+
|
|
34
|
+
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|
|
35
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
36
|
+
| `type` | 动画类型,见下方 type 值说明 | string | - |
|
|
37
|
+
| `action` | 触发方式,initial-初始化执行; click-点击执行 | string | initial |
|
|
38
|
+
| `loop` | 是否循环执行。true-循环执行; false-执行一次 | boolean | false |
|
|
39
|
+
| `duration` | 动画时长,单位 ms | number \ | string |
|
|
40
|
+
|
|
41
|
+
### 2.2 Events 事件
|
|
42
|
+
|
|
43
|
+
| 事件名 | 类型 | 说明 |
|
|
44
|
+
| :--- | :--- | :--- |
|
|
45
|
+
| `click` | 点击元素时触发 | event: Event |
|
|
46
|
+
|
|
47
|
+
### 2.3 Methods 方法
|
|
48
|
+
|
|
49
|
+
| 方法名 | 参数 | 说明 |
|
|
50
|
+
| :--- | :--- | :--- |
|
|
51
|
+
无
|
|
52
|
+
|
|
53
|
+
### 2.4 Slots 插槽
|
|
54
|
+
|
|
55
|
+
| 插槽名 | 说明 |
|
|
56
|
+
| :--- | :--- |
|
|
57
|
+
无
|
|
58
|
+
|
|
59
|
+
## 3. 例子 (Examples)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
## 4. 相关组件 (Related Components)
|
|
64
|
+
- **fox-js**: 与 Animate 配合使用的相关组件
|
|
65
|
+
- **fox-button**: 与 Animate 配合使用的相关组件
|
|
66
|
+
|
|
@@ -0,0 +1,76 @@
|
|
|
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: Audio 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 音频播放器
|
|
12
|
+
tags: [foxui, fox-audio, FoxAudio]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js","fox-voice","fox-audio-operate-group","fox-audio-operate"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Audio 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
Audio 是 foxui 中用于 **音频播放器** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-audio` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
23
|
+
- **核心增强**: 基于 NutUI 组件二次封装
|
|
24
|
+
- **适用场景**: 音频播放器
|
|
25
|
+
|
|
26
|
+
> 💡 **关键原则**: 在所有 音频播放器 中,**必须**优先使用此组件,禁止直接使用原生 NutUI 组件。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. 关键 API 说明 (Key API)
|
|
31
|
+
|
|
32
|
+
### 2.1 Props 属性
|
|
33
|
+
|
|
34
|
+
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|
|
35
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
36
|
+
| `url` | 语音播放的连接 | String | '' |
|
|
37
|
+
| `muted` | 是否静音 | Boolean | false |
|
|
38
|
+
| `autoplay` | 是否自动播放 | Boolean | false |
|
|
39
|
+
| `loop` | 是否循环播放 | Boolean | false |
|
|
40
|
+
| `preload` | 是否预加载语音 | String | 'auto' |
|
|
41
|
+
| `type` | 展示形式,可选值:controls 控制面板 progress 进度条 icon 图标 none 自定义 | String | 'progress' |
|
|
42
|
+
|
|
43
|
+
### 2.2 Events 事件
|
|
44
|
+
|
|
45
|
+
| 事件名 | 类型 | 说明 |
|
|
46
|
+
| :--- | :--- | :--- |
|
|
47
|
+
| `fast-back` | 触发语音快退 | 返回当前播放时长(单位:毫秒) |
|
|
48
|
+
| `forward` | 触发语音快进 | 返回当前播放时长(单位:毫秒) |
|
|
49
|
+
| `play` | 触发播放/暂停语音 | 返回当前播放状态 |
|
|
50
|
+
| `ended` | 语音播放完成,当 loop == false 时生效 | —— |
|
|
51
|
+
| `mute` | 触发静音 | —— |
|
|
52
|
+
| `change-progress` | 当进度条改变时触发 | 返回当前播放时长(单位:毫秒) |
|
|
53
|
+
| `can-play` | 当可以播放媒体文件时触发 | event: Event |
|
|
54
|
+
|
|
55
|
+
### 2.3 Methods 方法
|
|
56
|
+
|
|
57
|
+
| 方法名 | 参数 | 说明 |
|
|
58
|
+
| :--- | :--- | :--- |
|
|
59
|
+
无
|
|
60
|
+
|
|
61
|
+
### 2.4 Slots 插槽
|
|
62
|
+
|
|
63
|
+
| 插槽名 | 说明 |
|
|
64
|
+
| :--- | :--- |
|
|
65
|
+
无
|
|
66
|
+
|
|
67
|
+
## 3. 例子 (Examples)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## 4. 相关组件 (Related Components)
|
|
72
|
+
- **fox-js**: 与 Audio 配合使用的相关组件
|
|
73
|
+
- **fox-voice**: 与 Audio 配合使用的相关组件
|
|
74
|
+
- **fox-audio-operate-group**: 与 Audio 配合使用的相关组件
|
|
75
|
+
- **fox-audio-operate**: 与 Audio 配合使用的相关组件
|
|
76
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
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: Avatar 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 头像
|
|
12
|
+
tags: [foxui, fox-avatar, FoxAvatar]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js","fox-header","fox-avata","fox-badge","fox-avatar-group","fox-cell"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Avatar 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
Avatar 是 foxui 中用于 **头像** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-avatar` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
23
|
+
- **核心增强**: 基于 NutUI 组件二次封装、适配 H5 与小程序多端、支持插槽扩展自定义内容、支持主题定制
|
|
24
|
+
- **适用场景**: 头像
|
|
25
|
+
|
|
26
|
+
> 💡 **关键原则**: 在所有 头像 中,**必须**优先使用此组件,禁止直接使用原生 NutUI 组件。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. 关键 API 说明 (Key API)
|
|
31
|
+
|
|
32
|
+
### 2.1 Props 属性
|
|
33
|
+
|
|
34
|
+
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|
|
35
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
36
|
+
| `size` | 头像的大小,可选值为:large、normal、small,支持输入数字 | string \ | number |
|
|
37
|
+
| `shape` | 头像的形状,可选值为:square、round | string | round |
|
|
38
|
+
| `color` | 字体颜色 | string | 666 |
|
|
39
|
+
| `bg-color` | 背景色 | string | eee |
|
|
40
|
+
|
|
41
|
+
### 2.2 Events 事件
|
|
42
|
+
|
|
43
|
+
| 事件名 | 类型 | 说明 |
|
|
44
|
+
| :--- | :--- | :--- |
|
|
45
|
+
无
|
|
46
|
+
|
|
47
|
+
### 2.3 Methods 方法
|
|
48
|
+
|
|
49
|
+
| 方法名 | 参数 | 说明 |
|
|
50
|
+
| :--- | :--- | :--- |
|
|
51
|
+
无
|
|
52
|
+
|
|
53
|
+
### 2.4 Slots 插槽
|
|
54
|
+
|
|
55
|
+
| 插槽名 | 说明 |
|
|
56
|
+
| :--- | :--- |
|
|
57
|
+
| `default` | 默认插槽,可放置图片、图标、文本等元素 |
|
|
58
|
+
|
|
59
|
+
## 3. 例子 (Examples)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
## 4. 相关组件 (Related Components)
|
|
64
|
+
- **fox-js**: 与 Avatar 配合使用的相关组件
|
|
65
|
+
- **fox-header**: 与 Avatar 配合使用的相关组件
|
|
66
|
+
- **fox-avata**: 与 Avatar 配合使用的相关组件
|
|
67
|
+
- **fox-badge**: 与 Avatar 配合使用的相关组件
|
|
68
|
+
- **fox-avatar-group**: 与 Avatar 配合使用的相关组件
|
|
69
|
+
- **fox-cell**: 与 Avatar 配合使用的相关组件
|
|
70
|
+
|