@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,200 @@
|
|
|
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: MessageBox 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 消息弹框
|
|
12
|
+
tags: [foxui, fox-message-box, FoxMessageBox]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js","fox-group","fox-row-item","fox-button"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# MessageBox 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
MessageBox 是 foxui 中用于 **消息弹框** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-message-box` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
23
|
+
- **核心增强**: 基于 NutUI 组件二次封装、支持主题定制
|
|
24
|
+
- **适用场景**: 消息弹框
|
|
25
|
+
|
|
26
|
+
> 💡 **关键原则**: 在所有 消息弹框 中,**必须**优先使用此组件,禁止直接使用原生 NutUI 组件。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. 关键 API 说明 (Key API)
|
|
31
|
+
|
|
32
|
+
### 2.1 Props 属性
|
|
33
|
+
|
|
34
|
+
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|
|
35
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
36
|
+
| `width` | 宽度 | String | - |
|
|
37
|
+
| `height` | 高度 | String/VNode | - |
|
|
38
|
+
| `type` | 弹框类型 | 'success' \ | 'info' \ |
|
|
39
|
+
| `icon` | 弹框图标 | String\ | Component |
|
|
40
|
+
| `close-icon` | 关闭图标 | String\ | Component |
|
|
41
|
+
| `show-close` | 是否显示关闭图标 | Boolean | true |
|
|
42
|
+
| `title` | 弹窗标题 | String | - |
|
|
43
|
+
| `message` | 弹窗消息 | String \ | Content \ |
|
|
44
|
+
| `show-confirm-button` | 是否显示确定按钮 | Boolean | true |
|
|
45
|
+
| `confirm-text` | 确定按钮文案 | String | ”确定“ |
|
|
46
|
+
| `confirm-button-class` | 确定按钮class | String | - |
|
|
47
|
+
| `confirm-button-style` | 确定按钮style | CSSProperties | - |
|
|
48
|
+
| `show-cancel-button` | 是否显示取消按钮 | Boolean | true |
|
|
49
|
+
| `cancel-text` | 取消按钮文案 | String | ”取消“ |
|
|
50
|
+
| `cancel-button-class` | 取消按钮class | String | - |
|
|
51
|
+
| `cancel-button-style` | 取消按钮style | CSSProperties | - |
|
|
52
|
+
| `callback` | 回调函数 | Function | - |
|
|
53
|
+
| `close-on-click-overlay` | 点击overlay关闭弹窗 | boolean | true |
|
|
54
|
+
|
|
55
|
+
### 2.2 Events 事件
|
|
56
|
+
|
|
57
|
+
| 事件名 | 类型 | 说明 |
|
|
58
|
+
| :--- | :--- | :--- |
|
|
59
|
+
无
|
|
60
|
+
|
|
61
|
+
### 2.3 Methods 方法
|
|
62
|
+
|
|
63
|
+
| 方法名 | 参数 | 说明 |
|
|
64
|
+
| :--- | :--- | :--- |
|
|
65
|
+
无
|
|
66
|
+
|
|
67
|
+
### 2.4 Slots 插槽
|
|
68
|
+
|
|
69
|
+
| 插槽名 | 说明 |
|
|
70
|
+
| :--- | :--- |
|
|
71
|
+
无
|
|
72
|
+
|
|
73
|
+
## 3. 例子 (Examples)
|
|
74
|
+
|
|
75
|
+
## 代码演示
|
|
76
|
+
### 基础用法
|
|
77
|
+
```html
|
|
78
|
+
<script lang="ts" setup>
|
|
79
|
+
import { ref, onMounted, onUnmounted } from 'vue'
|
|
80
|
+
import { MessageBox, Toast } from '@/foxui.vue.build'
|
|
81
|
+
// alert提示
|
|
82
|
+
const onAlert = async () => {
|
|
83
|
+
const ret = await MessageBox.alert(
|
|
84
|
+
'模拟系统的消息提示框而实现的一套模态对话框组件,用于消息提示、确认消息。',
|
|
85
|
+
'消息弹框标题'
|
|
86
|
+
)
|
|
87
|
+
Toast.text(ret.action)
|
|
88
|
+
}
|
|
89
|
+
// 内容
|
|
90
|
+
const content = [
|
|
91
|
+
{
|
|
92
|
+
title: '阻断项:',
|
|
93
|
+
content: ['该业务不存在签约人信息', '账户信息为空,请录入账户信息']
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
title: '提示项:',
|
|
97
|
+
content: ['【营业执照】未上传', '【卖方信息】为空']
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
// confirm提示
|
|
101
|
+
const onConfirm = async () => {
|
|
102
|
+
const ret = await MessageBox.confirm(content, '标题')
|
|
103
|
+
Toast.text(ret.action)
|
|
104
|
+
}
|
|
105
|
+
</script>
|
|
106
|
+
<template>
|
|
107
|
+
<fox-group title="基本用法" column="1">
|
|
108
|
+
<fox-row-item align="left">
|
|
109
|
+
<fox-button @click="onAlert">Alert提示</fox-button>
|
|
110
|
+
<fox-button @click="onConfirm">Confirm提示</fox-button>
|
|
111
|
+
</fox-row-item>
|
|
112
|
+
</fox-group>
|
|
113
|
+
</template>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 弹窗类型
|
|
117
|
+
通过options的type属性设置弹框类型
|
|
118
|
+
``` html
|
|
119
|
+
<script lang="ts" setup>
|
|
120
|
+
import { ref, onMounted, onUnmounted } from 'vue'
|
|
121
|
+
import { MessageBox, Toast } from '@/foxui.vue.build'
|
|
122
|
+
// 内容
|
|
123
|
+
const content = [
|
|
124
|
+
{
|
|
125
|
+
title: '阻断项:',
|
|
126
|
+
content: ['该业务不存在签约人信息', '账户信息为空,请录入账户信息']
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
title: '提示项:',
|
|
130
|
+
content: ['【营业执照】未上传', '【卖方信息】为空']
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
// confirm提示
|
|
134
|
+
const onConfirm = async () => {
|
|
135
|
+
const ret = await MessageBox.confirm(content, '标题')
|
|
136
|
+
Toast.text(ret.action)
|
|
137
|
+
}
|
|
138
|
+
// confirm提示
|
|
139
|
+
const onShow = async (type?: 'success' | 'warning' | 'error' | 'info') => {
|
|
140
|
+
const ret = await MessageBox.alert(content, { type: type ?? 'info' })
|
|
141
|
+
Toast.text(ret.action)
|
|
142
|
+
}
|
|
143
|
+
</script>
|
|
144
|
+
<template>
|
|
145
|
+
|
|
146
|
+
<fox-group title="弹窗类型" column="1">
|
|
147
|
+
<fox-row-item align="left">
|
|
148
|
+
<fox-button @click="onShow">默认</fox-button>
|
|
149
|
+
<fox-button @click="onShow('success')">成功</fox-button>
|
|
150
|
+
<fox-button @click="onShow('warning')">警告</fox-button>
|
|
151
|
+
<fox-button @click="onShow('error')">错误</fox-button>
|
|
152
|
+
</fox-row-item>
|
|
153
|
+
</fox-group>
|
|
154
|
+
</template>
|
|
155
|
+
<style lang="scss" scope>
|
|
156
|
+
.fox-button + .fox-button {
|
|
157
|
+
margin-left: 20px;
|
|
158
|
+
}
|
|
159
|
+
</style>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### 自定义
|
|
163
|
+
```html
|
|
164
|
+
<!--
|
|
165
|
+
* @version: 1.0
|
|
166
|
+
* @Author: 江成
|
|
167
|
+
* @Date: 2024-03-02 09:11:11
|
|
168
|
+
-->
|
|
169
|
+
<script lang="ts" setup>
|
|
170
|
+
import { ref, onMounted, onUnmounted } from 'vue'
|
|
171
|
+
import { MessageBox, Toast } from '@/foxui.vue.build'
|
|
172
|
+
// 定义button text和样式
|
|
173
|
+
const onCustomButton = async () => {
|
|
174
|
+
const ret = await MessageBox.confirm(
|
|
175
|
+
'模拟系统的消息提示框而实现的一套模态对话框组件,用于消息提示、确认消息。',
|
|
176
|
+
'消息弹框标题',
|
|
177
|
+
{
|
|
178
|
+
type: 'info',
|
|
179
|
+
confirmText: '继续创建',
|
|
180
|
+
confirmButtonStyle: { color: 'red' }
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
Toast.text(ret.action)
|
|
184
|
+
}
|
|
185
|
+
</script>
|
|
186
|
+
<template>
|
|
187
|
+
<fox-group title="自定义" column="1">
|
|
188
|
+
<fox-row-item align="left">
|
|
189
|
+
<fox-button @click="onCustomButton">自定义按钮</fox-button>
|
|
190
|
+
</fox-row-item>
|
|
191
|
+
</fox-group>
|
|
192
|
+
</template>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## 4. 相关组件 (Related Components)
|
|
196
|
+
- **fox-js**: 与 MessageBox 配合使用的相关组件
|
|
197
|
+
- **fox-group**: 与 MessageBox 配合使用的相关组件
|
|
198
|
+
- **fox-row-item**: 与 MessageBox 配合使用的相关组件
|
|
199
|
+
- **fox-button**: 与 MessageBox 配合使用的相关组件
|
|
200
|
+
|
|
@@ -0,0 +1,174 @@
|
|
|
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: MoneyItem 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 金额输入框,用于金额输入
|
|
12
|
+
tags: [foxui, fox-money-item, FoxMoneyItem]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# MoneyItem 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
MoneyItem 是 foxui 中用于 **金额输入框,用于金额输入** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-money-item` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
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` | 输入值,双向绑定 | String | - |
|
|
37
|
+
| `min` | 最小值限制 | String、Number | - |
|
|
38
|
+
| `minInclude` | 限制是否包括最小值 | Boolean | true |
|
|
39
|
+
| `max` | 最大值限制 | String、Number | - |
|
|
40
|
+
| `maxInclude` | 限制是否包括最大值 | Boolean | true |
|
|
41
|
+
| `rates` | 换算利率 | String、Number | 1 |
|
|
42
|
+
| `precision` | 换算利率计算精度 | Number | - |
|
|
43
|
+
| `integerLength` | 输入整数部分长度 | String、Number | - |
|
|
44
|
+
| `decimalLength` | 输入小数部分长度 | String、Number | - |
|
|
45
|
+
| `autoPadding` | 是否自动填充小数位 | String、Bolean | true |
|
|
46
|
+
| `digits` | 分块长度 | String、Number | 3 |
|
|
47
|
+
| `separator` | 分块分割符 | String | , |
|
|
48
|
+
| `placeholder` | 为空时占位符 | String | - |
|
|
49
|
+
| `max-length` | 限制最长输入字符 | String、Number | - |
|
|
50
|
+
| `clearable` | 展示清除icon | Boolean | true |
|
|
51
|
+
| `text-align` | 文本位置,可选值left,center,right | String | left |
|
|
52
|
+
| `unit` | 单位 | String | - |
|
|
53
|
+
| `label` | 标签 | String | - |
|
|
54
|
+
| `label-width` | 标签宽度 | String | - |
|
|
55
|
+
| `label-position` | 标签位置可选值left,right,top | String | - |
|
|
56
|
+
| `is-required` | 左侧号是否展示 | Boolean | false |
|
|
57
|
+
| `disabled` | 是否禁用 | Boolean | false |
|
|
58
|
+
| `readonly` | 是否只读 | Boolean | false |
|
|
59
|
+
| `error-tip` | 错误提示 | String | - |
|
|
60
|
+
| `error-icon` | 错误提示图标 | String | - |
|
|
61
|
+
| `warn-tip` | 警告提示 | String | - |
|
|
62
|
+
| `wran-icon` | 警告提示图标 | String | - |
|
|
63
|
+
| `info-tip` | 提示 | String | - |
|
|
64
|
+
| `info-icon` | 提示图标 | String | - |
|
|
65
|
+
| `adjust-position` | 键盘弹起时,是否自动上推页面(仅支持小程序) | Boolean | true |
|
|
66
|
+
| `always-system` | 是否强制使用系统键盘和 Web-view 创建的 input 元素。为 true 时,confirm-type、confirm-hold 可能失效(仅支持小程序) | Boolean | false |
|
|
67
|
+
|
|
68
|
+
### 2.2 Events 事件
|
|
69
|
+
|
|
70
|
+
| 事件名 | 类型 | 说明 |
|
|
71
|
+
| :--- | :--- | :--- |
|
|
72
|
+
| `change` | 输入内容时触发 | val |
|
|
73
|
+
| `focus` | 聚焦时触发 | val |
|
|
74
|
+
| `blur` | 失焦时触发 | val |
|
|
75
|
+
| `clear` | 点击清空时触发 | val |
|
|
76
|
+
|
|
77
|
+
### 2.3 Methods 方法
|
|
78
|
+
|
|
79
|
+
| 方法名 | 参数 | 说明 |
|
|
80
|
+
| :--- | :--- | :--- |
|
|
81
|
+
无
|
|
82
|
+
|
|
83
|
+
### 2.4 Slots 插槽
|
|
84
|
+
|
|
85
|
+
| 插槽名 | 说明 |
|
|
86
|
+
| :--- | :--- |
|
|
87
|
+
| `default` | label内容 |
|
|
88
|
+
| `prepend` | 左侧自定义内容 |
|
|
89
|
+
| `append` | 右侧自定义内容 |
|
|
90
|
+
|
|
91
|
+
## 3. 例子 (Examples)
|
|
92
|
+
|
|
93
|
+
## 代码演示
|
|
94
|
+
### 基础用法
|
|
95
|
+
常用属性与事件
|
|
96
|
+
```html
|
|
97
|
+
<fox-money-item v-model="val" @change="onChange" @focus="onFocus" @blur="onBlur" @clear="onClear">普通</fox-money-item>
|
|
98
|
+
<fox-money-item v-model="val2" decimal-length="2" unit="元" clearable placeholder="请输入">小数2位</fox-money-item>
|
|
99
|
+
<fox-money-item v-model="val3" decimal-length="2" auto-adding="true" unit="元">自动填充</fox-money-item>
|
|
100
|
+
```
|
|
101
|
+
### 范围
|
|
102
|
+
设置最大最小值范围,整数、小数部分长度
|
|
103
|
+
```html
|
|
104
|
+
<fox-money-item v-model="val4" unit="元" min="0">非负数</fox-money-item>
|
|
105
|
+
<fox-money-item v-model="val5" unit="元" min="5" max="100" required>最大最小值</fox-money-item>
|
|
106
|
+
<fox-money-item v-model="val6" unit="元" integer-length="5" decimal-length="3">整5小3</fox-money-item>
|
|
107
|
+
<fox-money-item v-model="val7" min="0" min-include="false" decimal-length="0" required>整数大于0</fox-money-item>
|
|
108
|
+
<fox-money-item v-model="val8" max="0" max-include="true" decimal-length="0" required>整数小于等于0</fox-money-item>
|
|
109
|
+
```
|
|
110
|
+
### 利率
|
|
111
|
+
通过rates设置输入框的value和v-model的转换利率,如输入1,实际model值为1000
|
|
112
|
+
```html
|
|
113
|
+
<fox-money-item v-model="val9" unit="万" rates="10000" decimal-length="6" precision="2">单位万</fox-money-item>
|
|
114
|
+
<fox-money-item v-model="val10" unit="%" rates="0.01" precision="2">百分比</fox-money-item>
|
|
115
|
+
```
|
|
116
|
+
### 代码
|
|
117
|
+
```ts
|
|
118
|
+
import { reactive, toRefs, watch } from 'vue'
|
|
119
|
+
import { createComponent } from '@/utils/create'
|
|
120
|
+
const { createDemo } = createComponent('input')
|
|
121
|
+
export default createDemo({
|
|
122
|
+
// setup
|
|
123
|
+
setup() {
|
|
124
|
+
// 数据
|
|
125
|
+
const data = reactive({
|
|
126
|
+
val: 444.44,
|
|
127
|
+
val2: '',
|
|
128
|
+
val3: '123,456',
|
|
129
|
+
val4: '',
|
|
130
|
+
val5: '',
|
|
131
|
+
val6: null,
|
|
132
|
+
val7: '',
|
|
133
|
+
val8: '',
|
|
134
|
+
val9: '99999999999999999999.99',
|
|
135
|
+
val10: 456
|
|
136
|
+
})
|
|
137
|
+
watch(
|
|
138
|
+
() => data.val9,
|
|
139
|
+
val => {
|
|
140
|
+
console.info(`金额:${val}元`)
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
watch(
|
|
144
|
+
() => data.val10,
|
|
145
|
+
val => {
|
|
146
|
+
console.info(`百分比:${val}`)
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
// 方法
|
|
150
|
+
const methods = {
|
|
151
|
+
onChange: (value: string | number, event: Event) => {
|
|
152
|
+
console.log('change: ', value, event)
|
|
153
|
+
},
|
|
154
|
+
onFocus: (value: string | number, event: Event) => {
|
|
155
|
+
console.log('focus:', value, event)
|
|
156
|
+
},
|
|
157
|
+
onBlur: (value: string | number, event: Event) => {
|
|
158
|
+
console.log('blur:', value, event)
|
|
159
|
+
},
|
|
160
|
+
onClear: (value: string | number) => {
|
|
161
|
+
console.log('clear:', value)
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
...toRefs(data),
|
|
166
|
+
...methods
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
})
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## 4. 相关组件 (Related Components)
|
|
173
|
+
- **fox-js**: 与 MoneyItem 配合使用的相关组件
|
|
174
|
+
|
|
@@ -0,0 +1,208 @@
|
|
|
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: MoreButton 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 更多按钮
|
|
12
|
+
tags: [foxui, fox-more-button, FoxMoreButton]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js","fox-group","fox-input-item","fox-date-item","fox-select-item","fox-row-item","fox-button"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# MoreButton 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
MoreButton 是 foxui 中用于 **更多按钮** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-more-button` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
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
|
+
| `modelValue` | value/v-model | Boolean | - |
|
|
37
|
+
| `type` | 组件类型 | primary | success |
|
|
38
|
+
| `disabled` | 是否禁用 | Boolean | - |
|
|
39
|
+
| `collapse-text` | 折叠提示文字 | String | - |
|
|
40
|
+
| `expand-text` | 展开提示文字 | String | 展开 |
|
|
41
|
+
| `icon` | icon | Object | - |
|
|
42
|
+
| `text-position` | 文本位置 | left/right | right |
|
|
43
|
+
|
|
44
|
+
### 2.2 Events 事件
|
|
45
|
+
|
|
46
|
+
| 事件名 | 类型 | 说明 |
|
|
47
|
+
| :--- | :--- | :--- |
|
|
48
|
+
无
|
|
49
|
+
|
|
50
|
+
### 2.3 Methods 方法
|
|
51
|
+
|
|
52
|
+
| 方法名 | 参数 | 说明 |
|
|
53
|
+
| :--- | :--- | :--- |
|
|
54
|
+
无
|
|
55
|
+
|
|
56
|
+
### 2.4 Slots 插槽
|
|
57
|
+
|
|
58
|
+
| 插槽名 | 说明 |
|
|
59
|
+
| :--- | :--- |
|
|
60
|
+
| `icon` | icon插槽 |
|
|
61
|
+
|
|
62
|
+
## 3. 例子 (Examples)
|
|
63
|
+
|
|
64
|
+
## 代码演示
|
|
65
|
+
|
|
66
|
+
### 基础用法
|
|
67
|
+
```html
|
|
68
|
+
<!--
|
|
69
|
+
* @Author: 江成
|
|
70
|
+
* @Date: 2022-11-03 14:21:27
|
|
71
|
+
-->
|
|
72
|
+
<script lang="ts" setup>
|
|
73
|
+
import { ref, reactive } from 'vue'
|
|
74
|
+
// source array
|
|
75
|
+
const sourceForArray = [
|
|
76
|
+
{ text: '男', value: '01' },
|
|
77
|
+
{ text: '女', value: '02' }
|
|
78
|
+
]
|
|
79
|
+
// data
|
|
80
|
+
const data = reactive({
|
|
81
|
+
name: '',
|
|
82
|
+
date: '',
|
|
83
|
+
sex: '',
|
|
84
|
+
keyword: '',
|
|
85
|
+
desc: ''
|
|
86
|
+
})
|
|
87
|
+
// 折叠变量
|
|
88
|
+
const collapse = ref(true)
|
|
89
|
+
</script>
|
|
90
|
+
<template>
|
|
91
|
+
<fox-group column="1">
|
|
92
|
+
<fox-input-item v-model="data.name" prop="name">姓名</fox-input-item>
|
|
93
|
+
<fox-date-item v-model="data.date" prop="date">日期</fox-date-item>
|
|
94
|
+
<fox-select-item v-model="data.sex" prop="sex" :source="sourceForArray">性别</fox-select-item>
|
|
95
|
+
<fox-group v-model:collapse="collapse" column="1">
|
|
96
|
+
<fox-input-item v-model="data.keyword" prop="keyword">关键字</fox-input-item>
|
|
97
|
+
<fox-input-item v-model="data.desc" prop="desc" type="text" show-limit="true">描述</fox-input-item>
|
|
98
|
+
</fox-group>
|
|
99
|
+
<fox-row-item align="right">
|
|
100
|
+
<fox-button>重置</fox-button>
|
|
101
|
+
<fox-button type="primary">查询</fox-button>
|
|
102
|
+
<fox-more-button v-model="collapse"></fox-more-button>
|
|
103
|
+
</fox-row-item>
|
|
104
|
+
</fox-group>
|
|
105
|
+
</template>
|
|
106
|
+
<style lang="scss" scoped></style>
|
|
107
|
+
```
|
|
108
|
+
### type样式设置
|
|
109
|
+
通过`type`属性设置`more-button`组件的样式
|
|
110
|
+
```html
|
|
111
|
+
<!--
|
|
112
|
+
* @version: 1.0
|
|
113
|
+
* @Author: 江成
|
|
114
|
+
* @Date: 2023-05-01 10:40:40
|
|
115
|
+
-->
|
|
116
|
+
<script lang="ts" setup>
|
|
117
|
+
import { ref, reactive } from 'vue'
|
|
118
|
+
// source array
|
|
119
|
+
const sourceForArray = [
|
|
120
|
+
{ text: '男', value: '01' },
|
|
121
|
+
{ text: '女', value: '02' }
|
|
122
|
+
]
|
|
123
|
+
// data
|
|
124
|
+
const data = reactive({
|
|
125
|
+
name: '',
|
|
126
|
+
date: '',
|
|
127
|
+
sex: '',
|
|
128
|
+
keyword: '',
|
|
129
|
+
desc: ''
|
|
130
|
+
})
|
|
131
|
+
// 折叠变量
|
|
132
|
+
const collapse = ref(true)
|
|
133
|
+
</script>
|
|
134
|
+
<template>
|
|
135
|
+
<fox-group column="1">
|
|
136
|
+
<fox-input-item v-model="data.name" prop="name">姓名</fox-input-item>
|
|
137
|
+
<fox-date-item v-model="data.date" prop="date">日期</fox-date-item>
|
|
138
|
+
<fox-select-item v-model="data.sex" prop="sex" :source="sourceForArray">性别</fox-select-item>
|
|
139
|
+
<fox-group v-model:collapse="collapse" column="1">
|
|
140
|
+
<fox-input-item v-model="data.keyword" prop="keyword">关键字</fox-input-item>
|
|
141
|
+
<fox-input-item v-model="data.desc" prop="desc" type="text" show-limit="true">描述</fox-input-item>
|
|
142
|
+
</fox-group>
|
|
143
|
+
<fox-row-item align="right">
|
|
144
|
+
<fox-more-button v-model="collapse" expand-text="default"></fox-more-button>
|
|
145
|
+
<fox-more-button v-model="collapse" expand-text="primary" type="primary"></fox-more-button>
|
|
146
|
+
<fox-more-button v-model="collapse" expand-text="success" type="success"></fox-more-button>
|
|
147
|
+
<fox-more-button v-model="collapse" expand-text="info" type="info"></fox-more-button>
|
|
148
|
+
<fox-more-button v-model="collapse" expand-text="warning" type="warning"></fox-more-button>
|
|
149
|
+
<fox-more-button v-model="collapse" expand-text="danger" type="danger"></fox-more-button>
|
|
150
|
+
</fox-row-item>
|
|
151
|
+
</fox-group>
|
|
152
|
+
</template>
|
|
153
|
+
<style lang="scss" scoped></style>
|
|
154
|
+
```
|
|
155
|
+
### text和icon设置
|
|
156
|
+
通过`collapse-text`, `expand-text`, `icon`属性设置`more-button`组件的样式
|
|
157
|
+
```html
|
|
158
|
+
<!--
|
|
159
|
+
* @version: 1.0
|
|
160
|
+
* @Author: 江成
|
|
161
|
+
* @Date: 2023-05-01 16:02:23
|
|
162
|
+
-->
|
|
163
|
+
<script lang="ts" setup>
|
|
164
|
+
import { ref, reactive } from 'vue'
|
|
165
|
+
import { ArrowUp } from '@fox-js/icons-vue'
|
|
166
|
+
// source array
|
|
167
|
+
const sourceForArray = [
|
|
168
|
+
{ text: '男', value: '01' },
|
|
169
|
+
{ text: '女', value: '02' }
|
|
170
|
+
]
|
|
171
|
+
// data
|
|
172
|
+
const data = reactive({
|
|
173
|
+
name: '',
|
|
174
|
+
date: '',
|
|
175
|
+
sex: '',
|
|
176
|
+
keyword: '',
|
|
177
|
+
desc: ''
|
|
178
|
+
})
|
|
179
|
+
// 折叠变量
|
|
180
|
+
const collapse = ref(true)
|
|
181
|
+
</script>
|
|
182
|
+
<template>
|
|
183
|
+
<fox-group column="1">
|
|
184
|
+
<fox-input-item v-model="data.name" prop="name">姓名</fox-input-item>
|
|
185
|
+
<fox-date-item v-model="data.date" prop="date">日期</fox-date-item>
|
|
186
|
+
<fox-select-item v-model="data.sex" prop="sex" :source="sourceForArray">性别</fox-select-item>
|
|
187
|
+
<fox-group v-model:collapse="collapse" column="1">>
|
|
188
|
+
<fox-input-item v-model="data.keyword" prop="keyword">关键字</fox-input-item>
|
|
189
|
+
<fox-input-item v-model="data.desc" prop="desc" type="text" show-limit="true">描述</fox-input-item>
|
|
190
|
+
</fox-group>
|
|
191
|
+
<fox-row-item align="right">
|
|
192
|
+
<fox-more-button v-model="collapse" expand-text="展开" collapse-text="收起"></fox-more-button>
|
|
193
|
+
<fox-more-button v-model="collapse" :icon="ArrowUp"></fox-more-button>
|
|
194
|
+
</fox-row-item>
|
|
195
|
+
</fox-group>
|
|
196
|
+
</template>
|
|
197
|
+
<style lang="scss" scoped></style>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## 4. 相关组件 (Related Components)
|
|
201
|
+
- **fox-js**: 与 MoreButton 配合使用的相关组件
|
|
202
|
+
- **fox-group**: 与 MoreButton 配合使用的相关组件
|
|
203
|
+
- **fox-input-item**: 与 MoreButton 配合使用的相关组件
|
|
204
|
+
- **fox-date-item**: 与 MoreButton 配合使用的相关组件
|
|
205
|
+
- **fox-select-item**: 与 MoreButton 配合使用的相关组件
|
|
206
|
+
- **fox-row-item**: 与 MoreButton 配合使用的相关组件
|
|
207
|
+
- **fox-button**: 与 MoreButton 配合使用的相关组件
|
|
208
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
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: Navbar 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 头部导航
|
|
12
|
+
tags: [foxui, fox-navbar, FoxNavbar]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js","fox-icon","fox-tabs","fox-tabpane"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Navbar 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
Navbar 是 foxui 中用于 **头部导航** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-navbar` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
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
|
+
| `title` | 标题名称 | String | - |
|
|
37
|
+
| `desc` | 右侧描述 | String | - |
|
|
38
|
+
| `left-show` | 是否展示左侧箭头 | Boolean | false |
|
|
39
|
+
| `tit-icon` | 标题中插入icon | String | - |
|
|
40
|
+
| `fixed` | 是否固定到顶部 | Boolean | false |
|
|
41
|
+
| `safe-area-inset-top` | 是否开启顶部安全区适配 | Boolean | false |
|
|
42
|
+
|
|
43
|
+
### 2.2 Events 事件
|
|
44
|
+
|
|
45
|
+
| 事件名 | 类型 | 说明 |
|
|
46
|
+
| :--- | :--- | :--- |
|
|
47
|
+
| `on-click-title` | 点击页面标题事件 | event:Event |
|
|
48
|
+
| `on-click-icon` | 点击页面标题icon事件 | event:Event |
|
|
49
|
+
| `on-click-right` | 点击右侧按钮事件 | event:Event |
|
|
50
|
+
| `on-click-back` | 左侧图标返回点击事件 | event:Event |
|
|
51
|
+
|
|
52
|
+
### 2.3 Methods 方法
|
|
53
|
+
|
|
54
|
+
| 方法名 | 参数 | 说明 |
|
|
55
|
+
| :--- | :--- | :--- |
|
|
56
|
+
无
|
|
57
|
+
|
|
58
|
+
### 2.4 Slots 插槽
|
|
59
|
+
|
|
60
|
+
| 插槽名 | 说明 |
|
|
61
|
+
| :--- | :--- |
|
|
62
|
+
| `left` | 自定义左侧内容 |
|
|
63
|
+
| `right` | 自定义右侧内容 |
|
|
64
|
+
| `content` | 自定义导航栏中间内容 |
|
|
65
|
+
|
|
66
|
+
## 3. 例子 (Examples)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 4. 相关组件 (Related Components)
|
|
71
|
+
- **fox-js**: 与 Navbar 配合使用的相关组件
|
|
72
|
+
- **fox-icon**: 与 Navbar 配合使用的相关组件
|
|
73
|
+
- **fox-tabs**: 与 Navbar 配合使用的相关组件
|
|
74
|
+
- **fox-tabpane**: 与 Navbar 配合使用的相关组件
|
|
75
|
+
|