@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,69 @@
|
|
|
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: BackTop 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 较长页面快捷返回顶部
|
|
12
|
+
tags: [foxui, fox-back-top, FoxBackTop]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# BackTop 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
BackTop 是 foxui 中用于 **较长页面快捷返回顶部** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-back-top` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
23
|
+
- **核心增强**: 基于 NutUI 组件二次封装、支持插槽扩展自定义内容、支持主题定制
|
|
24
|
+
- **适用场景**: 较长页面快捷返回顶部
|
|
25
|
+
|
|
26
|
+
> 💡 **关键原则**: 在所有 较长页面快捷返回顶部 中,**必须**优先使用此组件,禁止直接使用原生 NutUI 组件。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. 关键 API 说明 (Key API)
|
|
31
|
+
|
|
32
|
+
### 2.1 Props 属性
|
|
33
|
+
|
|
34
|
+
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|
|
35
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
36
|
+
| `el-id` | 获取监听元素的父级元素 | String | - |
|
|
37
|
+
| `bottom` | 距离页面底部距离 | Number | 20 |
|
|
38
|
+
| `right` | 距离页面右侧距离 | Number | 10 |
|
|
39
|
+
| `distance` | 页面垂直滚动多高后出现 | Number | 200 |
|
|
40
|
+
| `z-index` | 设置组件页面层级 | Number | 10 |
|
|
41
|
+
| `is-animation` | 是否有动画,和duration参数互斥 | Boolean | true |
|
|
42
|
+
| `duration` | 设置动画持续时间 | Number | 1000 |
|
|
43
|
+
|
|
44
|
+
### 2.2 Events 事件
|
|
45
|
+
|
|
46
|
+
| 事件名 | 类型 | 说明 |
|
|
47
|
+
| :--- | :--- | :--- |
|
|
48
|
+
| `click` | 按钮点击时触发事件 | event: MouseEvent |
|
|
49
|
+
|
|
50
|
+
### 2.3 Methods 方法
|
|
51
|
+
|
|
52
|
+
| 方法名 | 参数 | 说明 |
|
|
53
|
+
| :--- | :--- | :--- |
|
|
54
|
+
无
|
|
55
|
+
|
|
56
|
+
### 2.4 Slots 插槽
|
|
57
|
+
|
|
58
|
+
| 插槽名 | 说明 |
|
|
59
|
+
| :--- | :--- |
|
|
60
|
+
| `default` | 默认 slot,用以自定义内容 |
|
|
61
|
+
| `content` | 内容 slot |
|
|
62
|
+
|
|
63
|
+
## 3. 例子 (Examples)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## 4. 相关组件 (Related Components)
|
|
68
|
+
- **fox-js**: 与 BackTop 配合使用的相关组件
|
|
69
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
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: Badge 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 徽标
|
|
12
|
+
tags: [foxui, fox-badge, FoxBadge]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js","fox-avatar","fox-icon"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Badge 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
Badge 是 foxui 中用于 **徽标** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-badge` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
23
|
+
- **核心增强**: 基于 NutUI 组件二次封装、适配 H5 与小程序多端、支持插槽扩展自定义内容、支持主题定制
|
|
24
|
+
- **适用场景**: 徽标
|
|
25
|
+
|
|
26
|
+
> 💡 **关键原则**: 在所有 徽标 中,**必须**优先使用此组件,禁止直接使用原生 NutUI 组件。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. 关键 API 说明 (Key API)
|
|
31
|
+
|
|
32
|
+
### 2.1 Props 属性
|
|
33
|
+
|
|
34
|
+
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|
|
35
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
36
|
+
| `value` | 显示的内容 | String | - |
|
|
37
|
+
| `max` | value 为数值时,最大值 | Number | 10000 |
|
|
38
|
+
| `z-index` | 徽标的 z-index 值 | Number | 10 |
|
|
39
|
+
| `dot` | 是否为小点 | Boolean | false |
|
|
40
|
+
| `hidden` | 是否隐藏 | Boolean | false |
|
|
41
|
+
| `top` | 上下偏移量,支持单位设置,可设置为:5px 等 | Number | 0 |
|
|
42
|
+
| `right` | 左右偏移量,支持单位设置,可设置为:5px 等 | Number | 0 |
|
|
43
|
+
| `color` | 徽标背景颜色 | String | fa2c19 |
|
|
44
|
+
|
|
45
|
+
### 2.2 Events 事件
|
|
46
|
+
|
|
47
|
+
| 事件名 | 类型 | 说明 |
|
|
48
|
+
| :--- | :--- | :--- |
|
|
49
|
+
无
|
|
50
|
+
|
|
51
|
+
### 2.3 Methods 方法
|
|
52
|
+
|
|
53
|
+
| 方法名 | 参数 | 说明 |
|
|
54
|
+
| :--- | :--- | :--- |
|
|
55
|
+
无
|
|
56
|
+
|
|
57
|
+
### 2.4 Slots 插槽
|
|
58
|
+
|
|
59
|
+
| 插槽名 | 说明 |
|
|
60
|
+
| :--- | :--- |
|
|
61
|
+
| `default` | 徽标包裹的子元素 |
|
|
62
|
+
| `icons` | 徽标自定义 |
|
|
63
|
+
|
|
64
|
+
## 3. 例子 (Examples)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## 4. 相关组件 (Related Components)
|
|
69
|
+
- **fox-js**: 与 Badge 配合使用的相关组件
|
|
70
|
+
- **fox-avatar**: 与 Badge 配合使用的相关组件
|
|
71
|
+
- **fox-icon**: 与 Badge 配合使用的相关组件
|
|
72
|
+
|
|
@@ -0,0 +1,116 @@
|
|
|
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: Barrage 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 用于视频弹幕等展示
|
|
12
|
+
tags: [foxui, fox-barrage, FoxBarrage]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Barrage 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
Barrage 是 foxui 中用于 **用于视频弹幕等展示** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-barrage` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
23
|
+
- **核心增强**: 基于 NutUI 组件二次封装、适配 H5 与小程序多端、支持插槽扩展自定义内容
|
|
24
|
+
- **适用场景**: 用于视频弹幕等展示
|
|
25
|
+
|
|
26
|
+
> 💡 **关键原则**: 在所有 用于视频弹幕等展示 中,**必须**优先使用此组件,禁止直接使用原生 NutUI 组件。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. 关键 API 说明 (Key API)
|
|
31
|
+
|
|
32
|
+
### 2.1 Props 属性
|
|
33
|
+
|
|
34
|
+
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|
|
35
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
36
|
+
| `danmu` | 弹幕列表数据 | Array | |
|
|
37
|
+
| `frequency` | 可视区域内每个弹幕出现的时间间隔 | number | 500 |
|
|
38
|
+
| `speeds` | 每个弹幕的滚动时间 | number | 5000 |
|
|
39
|
+
| `rows` | 弹幕行数,分几行展示 | number | 3 |
|
|
40
|
+
| `top` | 弹幕垂直距离 | number | 10 |
|
|
41
|
+
| `loop` | 是否循环播放 | boolean | true |
|
|
42
|
+
|
|
43
|
+
### 2.2 Events 事件
|
|
44
|
+
|
|
45
|
+
| 事件名 | 类型 | 说明 |
|
|
46
|
+
| :--- | :--- | :--- |
|
|
47
|
+
| `add` | 添加数据通过 ref 实例使用 | - |
|
|
48
|
+
|
|
49
|
+
### 2.3 Methods 方法
|
|
50
|
+
|
|
51
|
+
| 方法名 | 参数 | 说明 |
|
|
52
|
+
| :--- | :--- | :--- |
|
|
53
|
+
无
|
|
54
|
+
|
|
55
|
+
### 2.4 Slots 插槽
|
|
56
|
+
|
|
57
|
+
| 插槽名 | 说明 |
|
|
58
|
+
| :--- | :--- |
|
|
59
|
+
无
|
|
60
|
+
|
|
61
|
+
## 3. 例子 (Examples)
|
|
62
|
+
|
|
63
|
+
## 代码演示
|
|
64
|
+
|
|
65
|
+
### 基础用法
|
|
66
|
+
|
|
67
|
+
`Icon` 的 `name` 属性支持传入图标名称或图片链接。
|
|
68
|
+
|
|
69
|
+
```html
|
|
70
|
+
<template>
|
|
71
|
+
<fox-barrage ref="danmu" :danmu="list"></fox-barrage>
|
|
72
|
+
<div class="test">
|
|
73
|
+
<button @click="addDanmu" class="add fox-button--primary">随机添加</button>
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
76
|
+
<script>
|
|
77
|
+
import { ref } from 'vue';
|
|
78
|
+
export default {
|
|
79
|
+
props: {},
|
|
80
|
+
setup() {
|
|
81
|
+
const inputVal = ref('');
|
|
82
|
+
const danmu = ref(null);
|
|
83
|
+
let list = ref(['画美不看', '不明觉厉', '喜大普奔', '男默女泪', '累觉不爱', '爷青结-']);
|
|
84
|
+
function addDanmu() {
|
|
85
|
+
let n = Math.random();
|
|
86
|
+
danmu.value.add('随机——' + String(n).substr(2, 10));
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
inputVal,
|
|
90
|
+
danmu,
|
|
91
|
+
list,
|
|
92
|
+
addDanmu
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
</script>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
### slot 用法
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
```html
|
|
104
|
+
<template>
|
|
105
|
+
<fox-barrage>
|
|
106
|
+
<span>aaa</span>
|
|
107
|
+
<span>bbb</span>
|
|
108
|
+
<span>ccc</span>
|
|
109
|
+
<span>ddd</span>
|
|
110
|
+
</fox-barrage>
|
|
111
|
+
</template>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## 4. 相关组件 (Related Components)
|
|
115
|
+
- **fox-js**: 与 Barrage 配合使用的相关组件
|
|
116
|
+
|
|
@@ -0,0 +1,203 @@
|
|
|
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: Button 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 按钮用于触发一个操作,如提交表单。
|
|
12
|
+
tags: [foxui, fox-button, FoxButton]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Button 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
Button 是 foxui 中用于 **按钮用于触发一个操作,如提交表单。** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-button` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
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` | 类型,可选值为 primary info warning danger success | String | default |
|
|
37
|
+
| `size` | 尺寸,可选值为 large small mini | String | normal |
|
|
38
|
+
| `shape` | 形状,可选值为 square | String | round |
|
|
39
|
+
| `color` | 按钮颜色,支持传入 linear-gradient 渐变色 | String | - |
|
|
40
|
+
| `plain` | 是否为朴素按钮 | Boolean | false |
|
|
41
|
+
| `disabled` | 是否禁用按钮 | Boolean | false |
|
|
42
|
+
| `block` | 是否为块级元素 | Boolean | false |
|
|
43
|
+
| `loading` | 按钮 loading 状态 | Boolean | false |
|
|
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
|
+
| `default` | 按钮内容 |
|
|
62
|
+
| `icon` | 按钮图标 |
|
|
63
|
+
|
|
64
|
+
## 3. 例子 (Examples)
|
|
65
|
+
|
|
66
|
+
## 代码演示
|
|
67
|
+
|
|
68
|
+
### 按钮类型
|
|
69
|
+
|
|
70
|
+
按钮支持 `default`、`primary`、`info`、`warning`、`danger`、`success` 六种类型,默认为 `default`。
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
```html
|
|
74
|
+
<template>
|
|
75
|
+
<fox-button type="primary">主要按钮</fox-button>
|
|
76
|
+
<fox-button type="info">信息按钮</fox-button>
|
|
77
|
+
<fox-button type="default">默认按钮</fox-button>
|
|
78
|
+
<fox-button type="danger">危险按钮</fox-button>
|
|
79
|
+
<fox-button type="warning">警告按钮</fox-button>
|
|
80
|
+
<fox-button type="success">成功按钮</fox-button>
|
|
81
|
+
</template>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 朴素按钮
|
|
85
|
+
|
|
86
|
+
通过 `plain` 属性将按钮设置为朴素按钮,朴素按钮的文字为按钮颜色,背景为白色。
|
|
87
|
+
|
|
88
|
+
```html
|
|
89
|
+
<template>
|
|
90
|
+
<fox-button plain type="primary">朴素按钮</fox-button>
|
|
91
|
+
<fox-button plain type="info">朴素按钮</fox-button>
|
|
92
|
+
</template>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 禁用状态
|
|
96
|
+
|
|
97
|
+
通过 `disabled` 属性来禁用按钮,禁用状态下按钮不可点击。
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<template>
|
|
101
|
+
<fox-button disabled type="primary">禁用状态</fox-button>
|
|
102
|
+
<fox-button plain disabled type="info">禁用状态</fox-button>
|
|
103
|
+
<fox-button plain disabled type="primary">禁用状态</fox-button>
|
|
104
|
+
</template>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 按钮形状
|
|
108
|
+
|
|
109
|
+
通过 `shape` 属性设置按钮形状,支持圆形、方形按钮,默认为圆形。
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
```html
|
|
113
|
+
<template>
|
|
114
|
+
<fox-button shape="square" type="primary">方形按钮</fox-button>
|
|
115
|
+
<fox-button type="info">圆形按钮</fox-button>
|
|
116
|
+
</template>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### 加载状态
|
|
120
|
+
|
|
121
|
+
```html
|
|
122
|
+
<template>
|
|
123
|
+
<fox-button loading type="info"></fox-button>
|
|
124
|
+
<fox-button loading type="warning">加载中...</fox-button>
|
|
125
|
+
<fox-button :loading="isLoading" type="success" @click="changeLoading">Click me!</fox-button>
|
|
126
|
+
</template>
|
|
127
|
+
|
|
128
|
+
<script>
|
|
129
|
+
import { ref } from 'vue';
|
|
130
|
+
export default {
|
|
131
|
+
setup(props) {
|
|
132
|
+
let isLoading = ref(false);
|
|
133
|
+
const changeLoading = () => {
|
|
134
|
+
isLoading.value = true;
|
|
135
|
+
setTimeout(() => {
|
|
136
|
+
isLoading.value = false;
|
|
137
|
+
}, 3000);
|
|
138
|
+
};
|
|
139
|
+
return {
|
|
140
|
+
isLoading,
|
|
141
|
+
changeLoading
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
</script>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 图标按钮
|
|
149
|
+
|
|
150
|
+
通过插槽icon来加入图标
|
|
151
|
+
|
|
152
|
+
```html
|
|
153
|
+
<template>
|
|
154
|
+
<fox-button shape="square" plain type="primary">
|
|
155
|
+
<template v-slot:icon><StarFill /></template>
|
|
156
|
+
</fox-button>
|
|
157
|
+
<fox-button shape="square" type="primary">
|
|
158
|
+
<template v-slot:icon><Star /></template>收藏
|
|
159
|
+
</fox-button>
|
|
160
|
+
</template>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
### 按钮尺寸
|
|
166
|
+
|
|
167
|
+
支持 `large`、`normal`、`small`、`mini` 四种尺寸,默认为 `normal`。
|
|
168
|
+
|
|
169
|
+
```html
|
|
170
|
+
<template>
|
|
171
|
+
<fox-button size="large" type="primary">大号按钮</fox-button>
|
|
172
|
+
<fox-button type="primary">普通按钮</fox-button>
|
|
173
|
+
<fox-button size="small" type="primary">小型按钮</fox-button>
|
|
174
|
+
<fox-button size="mini" type="primary">迷你按钮</fox-button>
|
|
175
|
+
</template>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### 块级元素
|
|
179
|
+
|
|
180
|
+
按钮在默认情况下为行内块级元素,通过 `block` 属性可以将按钮的元素类型设置为块级元素,常用来实现通栏按钮。
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
```html
|
|
184
|
+
<template>
|
|
185
|
+
<fox-button block type="primary">块级元素</fox-button>
|
|
186
|
+
</template>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### 自定义颜色
|
|
190
|
+
|
|
191
|
+
通过 color 属性可以自定义按钮的颜色。
|
|
192
|
+
|
|
193
|
+
```html
|
|
194
|
+
<template>
|
|
195
|
+
<fox-button color="#7232dd">单色按钮</fox-button>
|
|
196
|
+
<fox-button color="#7232dd" plain>单色按钮</fox-button>
|
|
197
|
+
<fox-button color="linear-gradient(to right, #ff6034, #ee0a24)"> 渐变色按钮 </fox-button>
|
|
198
|
+
</template>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## 4. 相关组件 (Related Components)
|
|
202
|
+
- **fox-js**: 与 Button 配合使用的相关组件
|
|
203
|
+
|