uview-pro 0.0.22 → 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/changelog.md +43 -0
- package/components/u-action-sheet/u-action-sheet.vue +1 -1
- package/components/u-alert-tips/u-alert-tips.vue +1 -1
- package/components/u-avatar/u-avatar.vue +1 -1
- package/components/u-badge/u-badge.vue +1 -1
- package/components/u-button/u-button.vue +1 -1
- package/components/u-calendar/u-calendar.vue +1 -1
- package/components/u-card/u-card.vue +1 -1
- package/components/u-cell-group/u-cell-group.vue +1 -1
- package/components/u-cell-item/u-cell-item.vue +1 -1
- package/components/u-checkbox/u-checkbox.vue +1 -1
- package/components/u-checkbox-group/u-checkbox-group.vue +1 -1
- package/components/u-circle-progress/u-circle-progress.vue +1 -1
- package/components/u-col/u-col.vue +1 -1
- package/components/u-collapse/u-collapse.vue +5 -5
- package/components/u-collapse-item/u-collapse-item.vue +38 -20
- package/components/u-count-down/u-count-down.vue +1 -1
- package/components/u-count-to/u-count-to.vue +1 -1
- package/components/u-divider/u-divider.vue +1 -1
- package/components/u-dropdown/u-dropdown.vue +1 -1
- package/components/u-dropdown-item/u-dropdown-item.vue +1 -1
- package/components/u-empty/u-empty.vue +1 -1
- package/components/u-field/u-field.vue +1 -1
- package/components/u-form/u-form.vue +1 -1
- package/components/u-form-item/u-form-item.vue +1 -1
- package/components/u-gap/u-gap.vue +1 -1
- package/components/u-grid/u-grid.vue +1 -1
- package/components/u-grid-item/u-grid-item.vue +1 -1
- package/components/u-icon/u-icon.vue +1 -1
- package/components/u-image/u-image.vue +1 -1
- package/components/u-index-anchor/u-index-anchor.vue +1 -1
- package/components/u-index-list/u-index-list.vue +1 -1
- package/components/u-keyboard/u-keyboard.vue +1 -1
- package/components/u-lazy-load/u-lazy-load.vue +1 -1
- package/components/u-line/u-line.vue +1 -1
- package/components/u-line-progress/u-line-progress.vue +1 -1
- package/components/u-link/u-link.vue +2 -2
- package/components/u-loading/u-loading.vue +1 -1
- package/components/u-loadmore/u-loadmore.vue +1 -1
- package/components/u-mask/u-mask.vue +1 -1
- package/components/u-message-input/u-message-input.vue +1 -1
- package/components/u-modal/u-modal.vue +1 -1
- package/components/u-navbar/u-navbar.vue +2 -2
- package/components/u-no-network/u-no-network.vue +1 -1
- package/components/u-notice-bar/u-notice-bar.vue +1 -1
- package/components/u-number-box/u-number-box.vue +1 -1
- package/components/u-picker/u-picker.vue +1 -1
- package/components/u-popup/u-popup.vue +1 -1
- package/components/u-radio/u-radio.vue +1 -1
- package/components/u-radio-group/u-radio-group.vue +1 -1
- package/components/u-rate/u-rate.vue +1 -1
- package/components/u-read-more/u-read-more.vue +2 -2
- package/components/u-row/u-row.vue +1 -1
- package/components/u-search/u-search.vue +1 -1
- package/components/u-section/u-section.vue +1 -1
- package/components/u-select/u-select.vue +1 -1
- package/components/u-skeleton/u-skeleton.vue +1 -1
- package/components/u-slider/u-slider.vue +1 -1
- package/components/u-steps/u-steps.vue +2 -2
- package/components/u-sticky/u-sticky.vue +2 -2
- package/components/u-subsection/u-subsection.vue +1 -1
- package/components/u-swipe-action/u-swipe-action.vue +2 -2
- package/components/u-swiper/u-swiper.vue +1 -1
- package/components/u-switch/u-switch.vue +1 -1
- package/components/u-table/u-table.vue +1 -1
- package/components/u-tabs/u-tabs.vue +1 -1
- package/components/u-tabs-swiper/u-tabs-swiper.vue +1 -1
- package/components/u-tag/u-tag.vue +1 -1
- package/components/u-td/u-td.vue +1 -1
- package/components/u-th/u-th.vue +1 -1
- package/components/u-time-line/u-time-line.vue +1 -1
- package/components/u-time-line-item/u-time-line-item.vue +1 -1
- package/components/u-toast/u-toast.vue +1 -1
- package/components/u-top-tips/u-top-tips.vue +1 -1
- package/components/u-tr/u-tr.vue +1 -1
- package/components/u-upload/u-upload.vue +1 -1
- package/components/u-verification-code/u-verification-code.vue +1 -1
- package/components/u-waterfall/u-waterfall.vue +1 -1
- package/index.ts +11 -2
- package/libs/function/color.ts +35 -1
- package/libs/request/index.ts +2 -2
- package/package.json +1 -1
- package/readme.md +11 -5
package/changelog.md
CHANGED
|
@@ -1,3 +1,46 @@
|
|
|
1
|
+
## 0.1.0(2025-09-21)
|
|
2
|
+
|
|
3
|
+
### ♻️ Code Refactoring | 代码重构
|
|
4
|
+
|
|
5
|
+
- **http:** 优化 HTTP 请求和响应拦截器 ([b9ea27f](https://github.com/anyup/uView-Pro/commit/b9ea27f7a2fc3425316211784a07b2cde030282a))
|
|
6
|
+
- 修改路由基础路径 ([23143c8](https://github.com/anyup/uView-Pro/commit/23143c839242fcd19c9c6ca73a8ff1bcfdb8b83b))
|
|
7
|
+
- 移除多个组件中未使用的样式标签 ([f8d353a](https://github.com/anyup/uView-Pro/commit/f8d353a0b99b3d9a2530d8d8a4bd8d0d5fe7dcc5))
|
|
8
|
+
- 更新项目文档链接和基础配置 ([435a1ea](https://github.com/anyup/uView-Pro/commit/435a1ea5b89f8ba850f3cd469f4583d3946f8142))
|
|
9
|
+
|
|
10
|
+
### 📦 Build System | 打包构建
|
|
11
|
+
|
|
12
|
+
- **vite:** 配置别名和服务器设置 ([b319288](https://github.com/anyup/uView-Pro/commit/b3192882a104963ab6a2c7b6c03e2fb8ee17f609))
|
|
13
|
+
- **vite:** 配置别名和服务器设置 ([9483730](https://github.com/anyup/uView-Pro/commit/9483730b371a5722511cd515d20a1eac28834f04))
|
|
14
|
+
- 添加修复空 CSS 文件的脚本 ([38b943d](https://github.com/anyup/uView-Pro/commit/38b943d0f1234978e90284fa759f13b604160e96))
|
|
15
|
+
|
|
16
|
+
### ✨ Features | 新功能
|
|
17
|
+
|
|
18
|
+
- **theme:** 支持自定义的color值传入 ([3de798f](https://github.com/anyup/uView-Pro/commit/3de798f8de48af07774376366f5472f463b07177))
|
|
19
|
+
|
|
20
|
+
### 💄 Styles | 风格
|
|
21
|
+
|
|
22
|
+
- 移除多余空格和换行 ([80df4d4](https://github.com/anyup/uView-Pro/commit/80df4d44b631b12adb1ae45a6dd0dfa69a2694b1))
|
|
23
|
+
|
|
24
|
+
### 📝 Documentation | 文档
|
|
25
|
+
|
|
26
|
+
- 更新交流群图片 ([3b71cb0](https://github.com/anyup/uView-Pro/commit/3b71cb092efd4c5a89c36ee559028d0fe438a013))
|
|
27
|
+
|
|
28
|
+
## 0.0.23(2025-09-15)
|
|
29
|
+
|
|
30
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
31
|
+
|
|
32
|
+
- **u-collapse:** fix accordion mode ([c411fef](https://github.com/anyup/uView-Pro/commit/c411fef340cff07ab06a64f623741e9c1ad125cb))
|
|
33
|
+
|
|
34
|
+
### 🚀 Chore | 构建/工程依赖/工具
|
|
35
|
+
|
|
36
|
+
- revert comments ([3eed330](https://github.com/anyup/uView-Pro/commit/3eed330c27a7026eb87cb9ef285d1ecbe6789552))
|
|
37
|
+
- **docs:** 增加贡献者 ([8b9d44e](https://github.com/anyup/uView-Pro/commit/8b9d44e281c02f639079b77b7c32cc0a566b35a1))
|
|
38
|
+
- **docs:** add contributors ([b4035da](https://github.com/anyup/uView-Pro/commit/b4035da5a39acc5ae9dcb13b06143cda6a73fec3))
|
|
39
|
+
|
|
40
|
+
### 📝 Documentation | 文档
|
|
41
|
+
|
|
42
|
+
- 更新交流群二维码图片 ([00c0581](https://github.com/anyup/uView-Pro/commit/00c058159ea9d169219474728e8b31cdc892ab2c))
|
|
43
|
+
|
|
1
44
|
## 0.0.22(2025-09-11)
|
|
2
45
|
|
|
3
46
|
### 🚀 Chore | 构建/工程依赖/工具
|
|
@@ -45,7 +45,7 @@ defineOptions({
|
|
|
45
45
|
/**
|
|
46
46
|
* actionSheet 操作菜单
|
|
47
47
|
* @description 本组件用于从底部弹出一个操作菜单,供用户选择并返回结果。本组件功能类似于uni的uni.showActionSheetAPI,配置更加灵活,所有平台都表现一致。
|
|
48
|
-
* @tutorial https://
|
|
48
|
+
* @tutorial https://uviewpro.cn/zh/components/actionSheet.html
|
|
49
49
|
* @property {Array<{ text: string; subText?: string; color?: string; fontSize?: string; disabled?: boolean }>} list 按钮的文字数组,见官方文档示例
|
|
50
50
|
* @property {{text: string; color?: string; fontSize?: string}} tips 顶部的提示文字,见官方文档示例
|
|
51
51
|
* @property {String} cancel-text 取消按钮的提示文字
|
|
@@ -57,7 +57,7 @@ defineOptions({
|
|
|
57
57
|
/**
|
|
58
58
|
* alertTips 警告提示
|
|
59
59
|
* @description 警告提示,展现需要关注的信息
|
|
60
|
-
* @tutorial https://
|
|
60
|
+
* @tutorial https://uviewpro.cn/zh/components/alertTips.html
|
|
61
61
|
* @property {String} title 显示的标题文字
|
|
62
62
|
* @property {String} description 辅助性文字,颜色比title浅一点,字号也小一点,可选
|
|
63
63
|
* @property {String} type 关闭按钮(默认为叉号icon图标)
|
|
@@ -26,7 +26,7 @@ let base64Avatar =
|
|
|
26
26
|
/**
|
|
27
27
|
* avatar 头像
|
|
28
28
|
* @description 本组件一般用于展示头像的地方,如个人中心,或者评论列表页的用户头像展示等场所。
|
|
29
|
-
* @tutorial https://
|
|
29
|
+
* @tutorial https://uviewpro.cn/zh/components/avatar.html
|
|
30
30
|
* @property {String} bg-color 背景颜色,一般显示文字时用(默认#ffffff)
|
|
31
31
|
* @property {String} src 头像路径,如加载失败,将会显示默认头像
|
|
32
32
|
* @property {String Number} size 头像尺寸,可以为指定字符串(large, default, mini),或者数值,单位rpx(默认default)
|
|
@@ -30,7 +30,7 @@ defineOptions({
|
|
|
30
30
|
/**
|
|
31
31
|
* badge 角标
|
|
32
32
|
* @description 本组件一般用于展示头像的地方,如个人中心,或者评论列表页的用户头像展示等场所。
|
|
33
|
-
* @tutorial https://
|
|
33
|
+
* @tutorial https://uviewpro.cn/zh/components/badge.html
|
|
34
34
|
* @property {String|Number} count 展示的数字,大于 overflowCount 时显示为 ${overflowCount}+,为0且show-zero为false时隐藏
|
|
35
35
|
* @property {Boolean} is-dot 不展示数字,只有一个小点(默认false)
|
|
36
36
|
* @property {Boolean} absolute 组件是否绝对定位,为true时,offset参数才有效(默认true)
|
|
@@ -71,7 +71,7 @@ defineOptions({
|
|
|
71
71
|
/**
|
|
72
72
|
* button 按钮
|
|
73
73
|
* @description Button 按钮
|
|
74
|
-
* @tutorial https://
|
|
74
|
+
* @tutorial https://uviewpro.cn/zh/components/button.html
|
|
75
75
|
* @property {String} size 按钮的大小
|
|
76
76
|
* @property {Boolean} ripple 是否开启点击水波纹效果
|
|
77
77
|
* @property {String} ripple-bg-color 水波纹的背景色,ripple为true时有效
|
|
@@ -92,7 +92,7 @@ defineOptions({
|
|
|
92
92
|
/**
|
|
93
93
|
* calendar 日历
|
|
94
94
|
* @description 此组件用于单个选择日期,范围选择日期等,日历被包裹在底部弹起的容器中。
|
|
95
|
-
* @tutorial https://
|
|
95
|
+
* @tutorial https://uviewpro.cn/zh/components/calendar.html
|
|
96
96
|
* @property {String} mode 选择日期的模式,date-为单个日期,range-为选择日期范围
|
|
97
97
|
* @property {Boolean} v-model 布尔值变量,用于控制日历的弹出与收起
|
|
98
98
|
* @property {Boolean} safe-area-inset-bottom 是否开启底部安全区适配(默认false)
|
|
@@ -83,7 +83,7 @@ defineOptions({
|
|
|
83
83
|
/**
|
|
84
84
|
* card 卡片
|
|
85
85
|
* @description 卡片组件一般用于多个列表条目,且风格统一的场景
|
|
86
|
-
* @tutorial https://
|
|
86
|
+
* @tutorial https://uviewpro.cn/zh/components/card.html
|
|
87
87
|
* @property {Boolean} full 卡片与屏幕两侧是否留空隙(默认false)
|
|
88
88
|
* @property {String} title 头部左边的标题
|
|
89
89
|
* @property {String} title-color 标题颜色(默认#303133)
|
|
@@ -19,7 +19,7 @@ defineOptions({
|
|
|
19
19
|
/**
|
|
20
20
|
* cellGroup 单元格父组件Group
|
|
21
21
|
* @description cell单元格一般用于一组列表的情况,比如个人中心页,设置页等。搭配u-cell-item
|
|
22
|
-
* @tutorial https://
|
|
22
|
+
* @tutorial https://uviewpro.cn/zh/components/cell.html
|
|
23
23
|
* @property {String} title 分组标题
|
|
24
24
|
* @property {Boolean} border 是否显示外边框(默认true)
|
|
25
25
|
* @property {Object} title-style 分组标题的的样式,对象形式,如{'font-size': '24rpx'} 或 {'fontSize': '24rpx'}
|
|
@@ -46,7 +46,7 @@ defineOptions({
|
|
|
46
46
|
/**
|
|
47
47
|
* cellItem 单元格Item
|
|
48
48
|
* @description cell单元格一般用于一组列表的情况,比如个人中心页,设置页等。搭配u-cell-group使用
|
|
49
|
-
* @tutorial https://
|
|
49
|
+
* @tutorial https://uviewpro.cn/zh/components/cell.html
|
|
50
50
|
* @property {String} title 左侧标题
|
|
51
51
|
* @property {String} icon 左侧图标名,只支持uView内置图标,见Icon 图标
|
|
52
52
|
* @property {Object} icon-style 左边图标的样式,对象形式
|
|
@@ -27,7 +27,7 @@ defineOptions({
|
|
|
27
27
|
/**
|
|
28
28
|
* checkbox 复选框
|
|
29
29
|
* @description 该组件需要搭配checkboxGroup组件使用,以便用户进行操作时,获得当前复选框组的选中情况。
|
|
30
|
-
* @tutorial https://
|
|
30
|
+
* @tutorial https://uviewpro.cn/zh/components/checkbox.html
|
|
31
31
|
* @property {String Number} icon-size 图标大小,单位rpx(默认20)
|
|
32
32
|
* @property {String Number} label-size label字体大小,单位rpx(默认28)
|
|
33
33
|
* @property {String Number} name checkbox组件的标示符
|
|
@@ -16,7 +16,7 @@ defineOptions({
|
|
|
16
16
|
/**
|
|
17
17
|
* checkboxGroup 开关选择器父组件Group
|
|
18
18
|
* @description 复选框组件一般用于需要多个选择的场景,该组件功能完整,使用方便
|
|
19
|
-
* @tutorial https://
|
|
19
|
+
* @tutorial https://uviewpro.cn/zh/components/checkbox.html
|
|
20
20
|
* @property {String Number} max 最多能选中多少个checkbox(默认999)
|
|
21
21
|
* @property {String Number} size 组件整体的大小,单位rpx(默认40)
|
|
22
22
|
* @property {Boolean} disabled 是否禁用所有checkbox(默认false)
|
|
@@ -42,7 +42,7 @@ defineOptions({
|
|
|
42
42
|
/**
|
|
43
43
|
* circleProgress 环形进度条
|
|
44
44
|
* @description 展示操作或任务的当前进度,比如上传文件,是一个圆形的进度条。注意:此组件的percent值只能动态增加,不能动态减少。
|
|
45
|
-
* @tutorial https://
|
|
45
|
+
* @tutorial https://uviewpro.cn/zh/components/circleProgress.html
|
|
46
46
|
* @property {String Number} percent 圆环进度百分比值,为数值类型,0-100
|
|
47
47
|
* @property {String} inactive-color 圆环的底色,默认为灰色(该值无法动态变更)(默认#ececec)
|
|
48
48
|
* @property {String} active-color 圆环激活部分的颜色(该值无法动态变更)(默认#19be6b)
|
|
@@ -15,7 +15,7 @@ defineOptions({
|
|
|
15
15
|
/**
|
|
16
16
|
* col 布局单元格
|
|
17
17
|
* @description 通过基础的 12 分栏,迅速简便地创建布局(搭配<u-row>使用)
|
|
18
|
-
* @tutorial https://
|
|
18
|
+
* @tutorial https://uviewpro.cn/zh/components/layout.html
|
|
19
19
|
* @property {String|Number} span 栅格占据的列数,总12等分(默认0)
|
|
20
20
|
* @property {String} text-align 文字水平对齐方式(默认left)
|
|
21
21
|
* @property {String|Number} offset 分栏左边偏移,计算方式与span相同(默认0)
|
|
@@ -15,7 +15,7 @@ defineOptions({
|
|
|
15
15
|
/**
|
|
16
16
|
* collapse 手风琴
|
|
17
17
|
* @description 通过折叠面板收纳内容区域
|
|
18
|
-
* @tutorial https://
|
|
18
|
+
* @tutorial https://uviewpro.cn/zh/components/collapse.html
|
|
19
19
|
* @property {Boolean} accordion 是否手风琴模式(默认true)
|
|
20
20
|
* @property {Boolean} arrow 是否显示标题右侧的箭头(默认true)
|
|
21
21
|
* @property {String} arrow-color 标题右侧箭头的颜色(默认#909399)
|
|
@@ -30,13 +30,13 @@ const props = defineProps(CollapseProps);
|
|
|
30
30
|
const emit = defineEmits(['change']);
|
|
31
31
|
|
|
32
32
|
// 子元素集合
|
|
33
|
-
const
|
|
33
|
+
const children = ref<any[]>([]);
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* 重新初始化一次内部的所有子元素的高度计算,用于异步获取数据渲染的情况
|
|
37
37
|
*/
|
|
38
38
|
function init() {
|
|
39
|
-
|
|
39
|
+
children.value.forEach((vm, index) => {
|
|
40
40
|
vm.init && vm.init();
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -49,7 +49,7 @@ function onChange(index: string | number) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
provide('u-collapse', {
|
|
52
|
-
|
|
52
|
+
children,
|
|
53
53
|
props,
|
|
54
54
|
init,
|
|
55
55
|
onChange
|
|
@@ -57,7 +57,7 @@ provide('u-collapse', {
|
|
|
57
57
|
|
|
58
58
|
defineExpose({
|
|
59
59
|
props,
|
|
60
|
-
|
|
60
|
+
children,
|
|
61
61
|
init,
|
|
62
62
|
onChange
|
|
63
63
|
});
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
</view>
|
|
8
8
|
<slot v-else name="title" />
|
|
9
9
|
<view class="u-icon-wrap">
|
|
10
|
-
<u-icon v-if="arrow" :color="arrowColor" :class="{ 'u-arrow-down-icon-active': isShow }" class="u-arrow-down-icon" name="arrow-down"
|
|
10
|
+
<u-icon v-if="arrow" :color="arrowColor" :class="{ 'u-arrow-down-icon-active': isShow }" class="u-arrow-down-icon" name="arrow-down" />
|
|
11
11
|
</view>
|
|
12
12
|
</template>
|
|
13
13
|
<slot v-else name="title-all" />
|
|
14
14
|
</view>
|
|
15
|
+
|
|
15
16
|
<view class="u-collapse-body" :style="{ height: isShow ? height + 'px' : '0' }">
|
|
16
17
|
<view class="u-collapse-content" :id="elId" :style="bodyStyle">
|
|
17
18
|
<slot></slot>
|
|
@@ -25,14 +26,12 @@ import { ref, watch, onMounted, useSlots, getCurrentInstance, nextTick, inject }
|
|
|
25
26
|
import { $u } from '../..';
|
|
26
27
|
import { CollapseItemProps } from './types';
|
|
27
28
|
|
|
28
|
-
defineOptions({
|
|
29
|
-
name: 'u-collapse-item'
|
|
30
|
-
});
|
|
29
|
+
defineOptions({ name: 'u-collapse-item' });
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
32
|
* collapseItem 手风琴Item
|
|
34
33
|
* @description 通过折叠面板收纳内容区域(搭配u-collapse使用)
|
|
35
|
-
* @tutorial https://
|
|
34
|
+
* @tutorial https://uviewpro.cn/zh/components/collapse.html
|
|
36
35
|
* @property {String} title 面板标题
|
|
37
36
|
* @property {String Number} index 主要用于事件的回调,标识那个Item被点击
|
|
38
37
|
* @property {Boolean} disabled 面板是否可以打开或收起(默认false)
|
|
@@ -44,7 +43,6 @@ defineOptions({
|
|
|
44
43
|
* @example <u-collapse-item :title="item.head" v-for="(item, index) in itemList" :key="index">{{item.body}}</u-collapse-item>
|
|
45
44
|
*/
|
|
46
45
|
const props = defineProps(CollapseItemProps);
|
|
47
|
-
|
|
48
46
|
const emit = defineEmits(['change']);
|
|
49
47
|
const slots = useSlots();
|
|
50
48
|
const instance = getCurrentInstance();
|
|
@@ -57,15 +55,17 @@ const bodyStyle = ref<Record<string, any>>({}); // 主体部分样式
|
|
|
57
55
|
const itemStyle = ref<Record<string, any>>({}); // 每个item的整体样式
|
|
58
56
|
const arrowColor = ref(''); // 箭头的颜色
|
|
59
57
|
const hoverClass = ref(''); // 头部按下时的效果样式类
|
|
60
|
-
const
|
|
61
|
-
|
|
58
|
+
const accordion = ref(true); // 是否显示右侧箭头
|
|
59
|
+
const arrow = ref(true);
|
|
60
|
+
|
|
62
61
|
const parent = inject<any>('u-collapse', null);
|
|
63
|
-
|
|
62
|
+
|
|
64
63
|
watch(
|
|
65
64
|
() => props.open,
|
|
66
65
|
val => {
|
|
67
66
|
isShow.value = val;
|
|
68
|
-
}
|
|
67
|
+
},
|
|
68
|
+
{ immediate: true }
|
|
69
69
|
);
|
|
70
70
|
|
|
71
71
|
/**
|
|
@@ -74,13 +74,16 @@ watch(
|
|
|
74
74
|
function init() {
|
|
75
75
|
if (parent) {
|
|
76
76
|
// 不存在时才添加本实例
|
|
77
|
-
if (!parent.
|
|
77
|
+
if (!parent.children.value.includes(instance?.exposed)) {
|
|
78
|
+
parent.children.value.push(instance?.exposed);
|
|
79
|
+
}
|
|
78
80
|
headStyle.value = parent.props.headStyle;
|
|
79
81
|
bodyStyle.value = parent.props.bodyStyle;
|
|
80
82
|
arrowColor.value = parent.props.arrowColor;
|
|
81
83
|
hoverClass.value = parent.props.hoverClass;
|
|
82
84
|
arrow.value = parent.props.arrow;
|
|
83
85
|
itemStyle.value = parent.props.itemStyle;
|
|
86
|
+
accordion.value = parent.props.accordion;
|
|
84
87
|
}
|
|
85
88
|
elId.value = $u.guid();
|
|
86
89
|
nextTick(() => {
|
|
@@ -89,17 +92,31 @@ function init() {
|
|
|
89
92
|
}
|
|
90
93
|
|
|
91
94
|
/**
|
|
92
|
-
* 点击
|
|
95
|
+
* 点击collapse head头部
|
|
93
96
|
*/
|
|
94
97
|
function headClick() {
|
|
95
98
|
if (props.disabled) return;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
|
|
100
|
+
if (accordion.value && parent) {
|
|
101
|
+
parent.children.value.forEach((vm: any) => {
|
|
102
|
+
if (vm.elId !== elId.value) {
|
|
103
|
+
vm.isShow = false;
|
|
104
|
+
} else {
|
|
105
|
+
vm.isShow = !vm.isShow;
|
|
106
|
+
emit('change', {
|
|
107
|
+
index: props.index,
|
|
108
|
+
show: vm.isShow
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
} else {
|
|
113
|
+
isShow.value = !isShow.value;
|
|
114
|
+
emit('change', {
|
|
115
|
+
index: props.index,
|
|
116
|
+
show: isShow.value
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
103
120
|
if (isShow.value) parent && parent.onChange && parent.onChange(props.index);
|
|
104
121
|
}
|
|
105
122
|
|
|
@@ -107,7 +124,7 @@ function headClick() {
|
|
|
107
124
|
* 查询内容高度
|
|
108
125
|
*/
|
|
109
126
|
function queryRect() {
|
|
110
|
-
// getRect为uView自带的节点查询简化方法,详见文档介绍:https://
|
|
127
|
+
// getRect为uView自带的节点查询简化方法,详见文档介绍:https://uviewpro.cn/zh/js/getRect.html
|
|
111
128
|
// 组件内部一般用this.$uGetRect,对外的为this.$u.getRect,二者功能一致,名称不同
|
|
112
129
|
$u.getRect('#' + elId.value, instance).then((res: any) => {
|
|
113
130
|
height.value = res.height;
|
|
@@ -117,6 +134,7 @@ function queryRect() {
|
|
|
117
134
|
onMounted(() => {
|
|
118
135
|
init();
|
|
119
136
|
});
|
|
137
|
+
|
|
120
138
|
defineExpose({
|
|
121
139
|
init,
|
|
122
140
|
isShow,
|
|
@@ -60,7 +60,7 @@ defineOptions({ name: 'u-count-down' });
|
|
|
60
60
|
/**
|
|
61
61
|
* countDown 倒计时
|
|
62
62
|
* @description 该组件一般使用于某个活动的截止时间上,通过数字的变化,给用户明确的时间感受,提示用户进行某一个行为操作。
|
|
63
|
-
* @tutorial https://
|
|
63
|
+
* @tutorial https://uviewpro.cn/zh/components/countDown.html
|
|
64
64
|
* @property {String | Number} timestamp 倒计时,单位为秒
|
|
65
65
|
* @property {Boolean} autoplay 是否自动开始倒计时,如果为false,需手动调用开始方法。见官网说明(默认true)
|
|
66
66
|
* @property {String} separator 分隔符,colon为英文冒号,zh为中文(默认colon)
|
|
@@ -20,7 +20,7 @@ defineOptions({ name: 'u-count-to' });
|
|
|
20
20
|
/**
|
|
21
21
|
* countTo 数字滚动
|
|
22
22
|
* @description 该组件一般用于需要滚动数字到某一个值的场景,目标要求是一个递增的值。
|
|
23
|
-
* @tutorial https://
|
|
23
|
+
* @tutorial https://uviewpro.cn/zh/components/countTo.html
|
|
24
24
|
* @property {String | Number} start-val 开始值
|
|
25
25
|
* @property {String | Number} end-val 结束值
|
|
26
26
|
* @property {String | Number} duration 滚动过程所需的时间,单位ms(默认2000)
|
|
@@ -34,7 +34,7 @@ defineOptions({
|
|
|
34
34
|
/**
|
|
35
35
|
* divider 分割线
|
|
36
36
|
* @description 区隔内容的分割线,一般用于页面底部"没有更多"的提示。
|
|
37
|
-
* @tutorial https://
|
|
37
|
+
* @tutorial https://uviewpro.cn/zh/components/divider.html
|
|
38
38
|
* @property {String Number} half-width 文字左或右边线条宽度,数值或百分比,数值时单位为rpx
|
|
39
39
|
* @property {String} border-color 线条颜色,优先级高于type(默认#dcdfe6)
|
|
40
40
|
* @property {String} color 文字颜色(默认#909399)
|
|
@@ -58,7 +58,7 @@ defineOptions({ name: 'u-dropdown' });
|
|
|
58
58
|
/**
|
|
59
59
|
* dropdown 下拉菜单
|
|
60
60
|
* @description 该组件一般用于向下展开菜单,同时可切换多个选项卡的场景
|
|
61
|
-
* @tutorial https://
|
|
61
|
+
* @tutorial https://uviewpro.cn/zh/components/dropdown.html
|
|
62
62
|
* @property {String} active-color 标题和选项卡选中的颜色(默认#2979ff)
|
|
63
63
|
* @property {String} inactive-color 标题和选项卡未选中的颜色(默认#606266)
|
|
64
64
|
* @property {Boolean} close-on-click-mask 点击遮罩是否关闭菜单(默认true)
|
|
@@ -32,7 +32,7 @@ defineOptions({ name: 'u-dropdown-item' });
|
|
|
32
32
|
/**
|
|
33
33
|
* dropdown-item 下拉菜单
|
|
34
34
|
* @description 该组件一般用于向下展开菜单,同时可切换多个选项卡的场景
|
|
35
|
-
* @tutorial https://
|
|
35
|
+
* @tutorial https://uviewpro.cn/zh/components/dropdown.html
|
|
36
36
|
* @property {String | Number} v-model 双向绑定选项卡选择值
|
|
37
37
|
* @property {String} title 菜单项标题
|
|
38
38
|
* @property {Array[Object]} options 选项数据,如果传入了默认slot,此参数无效
|
|
@@ -27,7 +27,7 @@ defineOptions({
|
|
|
27
27
|
/**
|
|
28
28
|
* empty 内容为空
|
|
29
29
|
* @description 该组件用于需要加载内容,但是加载的第一页数据就为空,提示一个"没有内容"的场景, 我们精心挑选了十几个场景的图标,方便您使用。
|
|
30
|
-
* @tutorial https://
|
|
30
|
+
* @tutorial https://uviewpro.cn/zh/components/empty.html
|
|
31
31
|
* @property {String} color 文字颜色(默认#c0c4cc)
|
|
32
32
|
* @property {String} text 文字提示(默认“无内容”)
|
|
33
33
|
* @property {String} src 自定义图标路径,如定义,mode参数会失效
|
|
@@ -88,7 +88,7 @@ defineOptions({ name: 'u-field' });
|
|
|
88
88
|
/**
|
|
89
89
|
* field 输入框
|
|
90
90
|
* @description 借助此组件,可以实现表单的输入, 有"text"和"textarea"类型的,此外,借助uView的picker和actionSheet组件可以快速实现上拉菜单,时间,地区选择等, 为表单解决方案的利器。
|
|
91
|
-
* @tutorial https://
|
|
91
|
+
* @tutorial https://uviewpro.cn/zh/components/field.html
|
|
92
92
|
* @property {String} type 输入框的类型(默认text)
|
|
93
93
|
* @property {String} icon label左边的图标,限uView的图标名称
|
|
94
94
|
* @property {Object} icon-style 左边图标的样式,对象形式
|
|
@@ -14,7 +14,7 @@ defineOptions({
|
|
|
14
14
|
/**
|
|
15
15
|
* form 表单
|
|
16
16
|
* @description 此组件一般用于表单场景,可以配置Input输入框,Select弹出框,进行表单验证等。
|
|
17
|
-
* @tutorial https://
|
|
17
|
+
* @tutorial https://uviewpro.cn/zh/components/form.html
|
|
18
18
|
* @property {Object} model 表单数据对象
|
|
19
19
|
* @property {Boolean} border-bottom 是否显示表单域的下划线边框
|
|
20
20
|
* @property {String} label-position 表单域提示文字的位置,left-左侧,top-上方
|
|
@@ -81,7 +81,7 @@ defineOptions({
|
|
|
81
81
|
/**
|
|
82
82
|
* form-item 表单item
|
|
83
83
|
* @description 此组件一般用于表单场景,可以配置Input输入框,Select弹出框,进行表单验证等。
|
|
84
|
-
* @tutorial https://
|
|
84
|
+
* @tutorial https://uviewpro.cn/zh/components/form.html
|
|
85
85
|
* @property {String} label 左侧提示文字
|
|
86
86
|
* @property {Object} prop 表单域model对象的属性名,在使用 validate、resetFields 方法的情况下,该属性是必填的
|
|
87
87
|
* @property {Boolean} border-bottom 是否显示表单域的下划线边框
|
|
@@ -13,7 +13,7 @@ defineOptions({
|
|
|
13
13
|
/**
|
|
14
14
|
* gap 间隔槽
|
|
15
15
|
* @description 该组件一般用于内容块之间的用一个灰色块隔开的场景,方便用户风格统一,减少工作量
|
|
16
|
-
* @tutorial https://
|
|
16
|
+
* @tutorial https://uviewpro.cn/zh/components/gap.html
|
|
17
17
|
* @property {String} bg-color 背景颜色(默认#f3f4f6)
|
|
18
18
|
* @property {String Number} height 分割槽高度,单位rpx(默认30)
|
|
19
19
|
* @property {String Number} margin-top 与前一个组件的距离,单位rpx(默认0)
|
|
@@ -13,7 +13,7 @@ defineOptions({ name: 'u-grid' });
|
|
|
13
13
|
/**
|
|
14
14
|
* grid 宫格布局
|
|
15
15
|
* @description 宫格组件一般用于同时展示多个同类项目的场景,可以给宫格的项目设置徽标组件(badge),或者图标等,也可以扩展为左右滑动的轮播形式。
|
|
16
|
-
* @tutorial https://
|
|
16
|
+
* @tutorial https://uviewpro.cn/zh/components/grid.html
|
|
17
17
|
* @property {String|Number} col 宫格的列数(默认3)
|
|
18
18
|
* @property {Boolean} border 是否显示宫格的边框(默认true)
|
|
19
19
|
* @property {Boolean} hover-class 点击宫格的时候,是否显示按下的灰色背景(默认false)
|
|
@@ -25,7 +25,7 @@ defineOptions({ name: 'u-grid-item' });
|
|
|
25
25
|
/**
|
|
26
26
|
* gridItem 宫格项
|
|
27
27
|
* @description 宫格组件一般用于同时展示多个同类项目的场景,可以给宫格的项目设置徽标组件(badge),或者图标等,也可以扩展为左右滑动的轮播形式。搭配u-grid使用
|
|
28
|
-
* @tutorial https://
|
|
28
|
+
* @tutorial https://uviewpro.cn/zh/components/grid.html
|
|
29
29
|
* @property {String} bg-color 宫格的背景颜色(默认#ffffff)
|
|
30
30
|
* @property {String|Number} index 点击宫格时,返回的值
|
|
31
31
|
* @property {Object} custom-style 自定义样式,对象形式
|
|
@@ -22,7 +22,7 @@ defineOptions({
|
|
|
22
22
|
/**
|
|
23
23
|
* icon 图标
|
|
24
24
|
* @description 基于字体的图标集,包含了大多数常见场景的图标。
|
|
25
|
-
* @tutorial https://
|
|
25
|
+
* @tutorial https://uviewpro.cn/zh/components/icon.html
|
|
26
26
|
* @property {String} name 图标名称,见示例图标集
|
|
27
27
|
* @property {String} color 图标颜色(默认inherit)
|
|
28
28
|
* @property {String | Number} size 图标字体大小,单位rpx(默认32)
|
|
@@ -34,7 +34,7 @@ defineOptions({
|
|
|
34
34
|
/**
|
|
35
35
|
* Image 图片
|
|
36
36
|
* @description 此组件为uni-app的image组件的加强版,在继承了原有功能外,还支持淡入动画、加载中、加载失败提示、圆角值和形状等。
|
|
37
|
-
* @tutorial https://
|
|
37
|
+
* @tutorial https://uviewpro.cn/zh/components/image.html
|
|
38
38
|
* @property {String} src 图片地址
|
|
39
39
|
* @property {String} mode 裁剪模式,见官网说明
|
|
40
40
|
* @property {String | Number} width 宽度,单位任意,如果为数值,则为rpx单位(默认100%)
|
|
@@ -24,7 +24,7 @@ defineOptions({
|
|
|
24
24
|
/**
|
|
25
25
|
* indexAnchor 索引列表锚点
|
|
26
26
|
* @description 通过折叠面板收纳内容区域,搭配<u-index-anchor>使用
|
|
27
|
-
* @tutorial https://
|
|
27
|
+
* @tutorial https://uviewpro.cn/zh/components/indexList.html#indexanchor-props
|
|
28
28
|
* @property {Boolean} use-slot 是否使用自定义内容的插槽(默认false)
|
|
29
29
|
* @property {String|Number} index 索引字符,如果定义了use-slot,此参数自动失效
|
|
30
30
|
* @property {Object} customStyle 自定义样式,对象形式,如"{color: 'red'}"
|
|
@@ -58,7 +58,7 @@ defineOptions({
|
|
|
58
58
|
/**
|
|
59
59
|
* indexList 索引列表
|
|
60
60
|
* @description 通过折叠面板收纳内容区域,搭配<u-index-anchor>使用
|
|
61
|
-
* @tutorial https://
|
|
61
|
+
* @tutorial https://uviewpro.cn/zh/components/indexList.html#indexanchor-props
|
|
62
62
|
* @property {Number|String} scroll-top 当前滚动高度,自定义组件无法获得滚动条事件,所以依赖接入方传入
|
|
63
63
|
* @property {Array} index-list 索引字符列表,数组(默认A-Z)
|
|
64
64
|
* @property {Number|String} z-index 锚点吸顶时的层级(默认965)
|
|
@@ -42,7 +42,7 @@ defineOptions({
|
|
|
42
42
|
/**
|
|
43
43
|
* keyboard 键盘
|
|
44
44
|
* @description 此为uViw自定义的键盘面板,内含了数字键盘,车牌号键,身份证号键盘3中模式,都有可以打乱按键顺序的选项。
|
|
45
|
-
* @tutorial https://
|
|
45
|
+
* @tutorial https://uviewpro.cn/zh/components/keyboard.html
|
|
46
46
|
* @property {String} mode 键盘类型,见官网基本使用的说明(默认number)
|
|
47
47
|
* @property {Boolean} dot-enabled 是否显示"."按键,只在mode=number时有效(默认true)
|
|
48
48
|
* @property {Boolean} tooltip 是否显示键盘顶部工具条(默认true)
|
|
@@ -43,7 +43,7 @@ defineOptions({ name: 'u-lazy-load' });
|
|
|
43
43
|
/**
|
|
44
44
|
* lazyLoad 懒加载
|
|
45
45
|
* @description 懒加载使用的场景为:页面有很多图片时,APP会同时加载所有的图片,导致页面卡顿,各个位置的图片出现前后不一致等.
|
|
46
|
-
* @tutorial https://
|
|
46
|
+
* @tutorial https://uviewpro.cn/zh/components/lazyLoad.html
|
|
47
47
|
* @property {String | Number} index 用户自定义值,在事件触发时回调,用以区分是哪个图片
|
|
48
48
|
* @property {String} image 图片路径
|
|
49
49
|
* @property {String} loading-img 预加载时的占位图
|
|
@@ -14,7 +14,7 @@ defineOptions({
|
|
|
14
14
|
/**
|
|
15
15
|
* line 线条
|
|
16
16
|
* @description 此组件一般用于显示一根线条,用于分隔内容块,有横向和竖向两种模式,且能设置0.5px线条,使用也很简单
|
|
17
|
-
* @tutorial https://
|
|
17
|
+
* @tutorial https://uviewpro.cn/zh/components/line.html
|
|
18
18
|
* @property {String} color 线条的颜色(默认#e4e7ed)
|
|
19
19
|
* @property {String} length 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带rpx单位的值等
|
|
20
20
|
* @property {String} direction 线条的方向,row-横向,col-竖向(默认row)
|
|
@@ -27,7 +27,7 @@ defineOptions({
|
|
|
27
27
|
/**
|
|
28
28
|
* lineProgress 线型进度条
|
|
29
29
|
* @description 展示操作或任务的当前进度,比如上传文件,是一个线形的进度条。
|
|
30
|
-
* @tutorial https://
|
|
30
|
+
* @tutorial https://uviewpro.cn/zh/components/lineProgress.html
|
|
31
31
|
* @property {String Number} percent 进度条百分比值,为数值类型,0-100
|
|
32
32
|
* @property {Boolean} round 进度条两端是否为半圆(默认true)
|
|
33
33
|
* @property {String} type 如设置,active-color值将会失效
|
|
@@ -24,14 +24,14 @@ defineOptions({
|
|
|
24
24
|
/**
|
|
25
25
|
* link 超链接
|
|
26
26
|
* @description 该组件为超链接组件,在不同平台有不同表现形式:在APP平台会通过plus环境打开内置浏览器,在小程序中把链接复制到粘贴板,同时提示信息,在H5中通过window.open打开链接。
|
|
27
|
-
* @tutorial https://
|
|
27
|
+
* @tutorial https://uviewpro.cn/zh/components/link.html
|
|
28
28
|
* @property {String} color 文字颜色(默认#606266)
|
|
29
29
|
* @property {String Number} font-size 字体大小,单位rpx(默认28)
|
|
30
30
|
* @property {Boolean} under-line 是否显示下划线(默认false)
|
|
31
31
|
* @property {String} href 跳转的链接,要带上http(s)
|
|
32
32
|
* @property {String} line-color 下划线颜色,默认同color参数颜色
|
|
33
33
|
* @property {String} mp-tips 各个小程序平台把链接复制到粘贴板后的提示语(默认“链接已复制,请在浏览器打开”)
|
|
34
|
-
* @example <u-link href="https://
|
|
34
|
+
* @example <u-link href="https://uviewpro.cn">蜀道难,难于上青天</u-link>
|
|
35
35
|
*/
|
|
36
36
|
const props = defineProps(LinkProps);
|
|
37
37
|
|
|
@@ -13,7 +13,7 @@ defineOptions({
|
|
|
13
13
|
/**
|
|
14
14
|
* loading 加载动画
|
|
15
15
|
* @description 此组件为一个小动画,目前用在uView的loadmore加载更多和switch开关等组件的正在加载状态场景。
|
|
16
|
-
* @tutorial https://
|
|
16
|
+
* @tutorial https://uviewpro.cn/zh/components/loading.html
|
|
17
17
|
* @property {String} mode 模式选择,见官网说明(默认circle)
|
|
18
18
|
* @property {String} color 动画活动区域的颜色,只对 mode = flower 模式有效(默认#c7c7c7)
|
|
19
19
|
* @property {String|Number} size 加载图标的大小,单位rpx(默认34)
|
|
@@ -38,7 +38,7 @@ defineOptions({ name: 'u-loadmore' });
|
|
|
38
38
|
/**
|
|
39
39
|
* loadmore 加载更多
|
|
40
40
|
* @description 此组件一般用于标识页面底部加载数据时的状态。
|
|
41
|
-
* @tutorial https://
|
|
41
|
+
* @tutorial https://uviewpro.cn/zh/components/loadMore.html
|
|
42
42
|
* @property {String} status 组件状态(默认loadmore)
|
|
43
43
|
* @property {String} bg-color 组件背景颜色,在页面是非白色时会用到(默认#ffffff)
|
|
44
44
|
* @property {Boolean} icon 加载中时是否显示图标(默认true)
|
|
@@ -24,7 +24,7 @@ defineOptions({ name: 'u-mask' });
|
|
|
24
24
|
/**
|
|
25
25
|
* mask 遮罩
|
|
26
26
|
* @description 创建一个遮罩层,用于强调特定的页面元素,并阻止用户对遮罩下层的内容进行操作,一般用于弹窗场景
|
|
27
|
-
* @tutorial https://
|
|
27
|
+
* @tutorial https://uviewpro.cn/zh/components/mask.html
|
|
28
28
|
* @property {Boolean} show 是否显示遮罩(默认false)
|
|
29
29
|
* @property {String|Number} z-index z-index 层级(默认1070)
|
|
30
30
|
* @property {Object} custom-style 自定义样式对象,见上方说明
|