uview-pro 0.3.15 → 0.3.16
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 +26 -0
- package/components/u-dropdown/types.ts +0 -5
- package/components/u-link/types.ts +5 -0
- package/components/u-link/u-link.vue +5 -0
- package/components/u-safe-bottom/props.ts +1 -1
- package/components/u-status-bar/props.ts +1 -1
- package/components/u-sticky/u-sticky.vue +0 -1
- package/components/u-tabs/u-tabs.vue +5 -0
- package/components/u-text/u-text.vue +7 -3
- package/components/u-waterfall/u-waterfall.vue +7 -6
- package/libs/hooks/useRect.ts +6 -4
- package/package.json +1 -1
- package/types/global.d.ts +1 -0
package/changelog.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
## 0.3.16(2025-11-21)
|
|
2
|
+
|
|
3
|
+
### 📝 Documentation | 文档
|
|
4
|
+
|
|
5
|
+
- 更新贡献者信息 ([a6d52dc](https://github.com/anyup/uView-Pro/commit/a6d52dc6db9d56ccdf5c5ad4230e32c716e36241))
|
|
6
|
+
|
|
7
|
+
### ♻️ Code Refactoring | 代码重构
|
|
8
|
+
|
|
9
|
+
- **u-waterfall:** 优化瀑布流组件性能和代码结构 ([841c465](https://github.com/anyup/uView-Pro/commit/841c465de4f1a1efc43e05248794b566e0051bd8))
|
|
10
|
+
- **pages:** 重构工具和模板页面,优化i18n国际化功能 ([6cfda7f](https://github.com/anyup/uView-Pro/commit/6cfda7f2ecfd6dd60501201d8797fe702b29df4d))
|
|
11
|
+
- **u-dropdown:** 删除无用的测试代码 ([7c06f1f](https://github.com/anyup/uView-Pro/commit/7c06f1f3f0d1dcd5ae2bbd3420a4124c5faec004))
|
|
12
|
+
|
|
13
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
14
|
+
|
|
15
|
+
- **backTop:** 修复回到顶部组件示例无效的问题 ([5a9b736](https://github.com/anyup/uView-Pro/commit/5a9b7366f5916627815488039327669f424dd0ce))
|
|
16
|
+
- **u-text:** 修复 u-text 组件单行省略号显示无效的问题 ([041ee36](https://github.com/anyup/uView-Pro/commit/041ee36fb60d5a082fbdde7e9334ae42b386944c))
|
|
17
|
+
|
|
18
|
+
### ✨ Features | 新功能
|
|
19
|
+
|
|
20
|
+
- **u-link:** 添加自定义点击跳转功能 ([8a521f3](https://github.com/anyup/uView-Pro/commit/8a521f36a9f417aa90263cdcf7978ce48d6ed01e))
|
|
21
|
+
- **u-tabs:** 增强 u-tabs 组件,支持隐藏 tab 项的功能配置 ([9a58964](https://github.com/anyup/uView-Pro/commit/9a58964061a7d18510624fb4c6d009568bd3974c))
|
|
22
|
+
|
|
23
|
+
### 👥 Contributors
|
|
24
|
+
|
|
25
|
+
<a href="https://github.com/anyup"><img src="https://github.com/anyup.png?size=40" width="40" height="40" alt="anyup" title="anyup"/></a>
|
|
26
|
+
|
|
1
27
|
## 0.3.15(2025-11-14)
|
|
2
28
|
|
|
3
29
|
### ✨ Features | 新功能
|
|
@@ -2,11 +2,6 @@ import type { ExtractPropTypes, PropType } from 'vue';
|
|
|
2
2
|
import { baseProps } from '../common/props';
|
|
3
3
|
import { getColor } from '../../';
|
|
4
4
|
|
|
5
|
-
try {
|
|
6
|
-
console.log(getColor('primary'));
|
|
7
|
-
} catch (e) {
|
|
8
|
-
console.log('get color error');
|
|
9
|
-
}
|
|
10
5
|
/**
|
|
11
6
|
* u-dropdown 下拉菜单 Props
|
|
12
7
|
* @description 该组件一般用于向下展开菜单,同时可切换多个选项卡的场景
|
|
@@ -43,12 +43,17 @@ import { LinkProps } from './types';
|
|
|
43
43
|
* @example <u-link href="https://uviewpro.cn">蜀道难,难于上青天</u-link>
|
|
44
44
|
*/
|
|
45
45
|
const props = defineProps(LinkProps);
|
|
46
|
+
const emit = defineEmits(['click']);
|
|
46
47
|
|
|
47
48
|
/**
|
|
48
49
|
* 打开链接方法
|
|
49
50
|
* 不同平台有不同表现形式
|
|
50
51
|
*/
|
|
51
52
|
function openLink() {
|
|
53
|
+
if (!props.defaultClick) {
|
|
54
|
+
emit('click', props.href);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
52
57
|
// #ifdef APP-PLUS
|
|
53
58
|
if (typeof plus !== 'undefined' && plus.runtime) {
|
|
54
59
|
plus.runtime.openURL(props.href);
|
|
@@ -119,7 +119,6 @@ function initObserver() {
|
|
|
119
119
|
// #ifndef H5
|
|
120
120
|
stickyTop.value = Number(props.offsetTop) !== 0 ? uni.upx2px(Number(props.offsetTop)) : 0;
|
|
121
121
|
// #endif
|
|
122
|
-
console.log('stickyTop.value', stickyTop.value);
|
|
123
122
|
disconnectObserver('contentObserver');
|
|
124
123
|
$u.getRect('.' + elClass.value, instance).then((res: any) => {
|
|
125
124
|
height.value = res.height;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
<view class="u-scroll-box" :id="id" :class="{ 'u-tabs-scroll-flex': !isScroll }">
|
|
7
7
|
<view
|
|
8
8
|
class="u-tab-item u-line-1"
|
|
9
|
+
:class="[item.hidden ? 'u-tab-item-hidden' : '']"
|
|
9
10
|
:id="'u-tab-item-' + index"
|
|
10
11
|
v-for="(item, index) in list"
|
|
11
12
|
:key="index"
|
|
@@ -290,6 +291,10 @@ scroll-view ::v-deep ::-webkit-scrollbar {
|
|
|
290
291
|
transition-property: background-color, color;
|
|
291
292
|
}
|
|
292
293
|
|
|
294
|
+
.u-tab-item-hidden {
|
|
295
|
+
display: none;
|
|
296
|
+
}
|
|
297
|
+
|
|
293
298
|
.u-tab-bar {
|
|
294
299
|
position: absolute;
|
|
295
300
|
bottom: 0;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:class="[
|
|
6
6
|
props.bold ? 'u-text--bold' : '',
|
|
7
7
|
props.block ? 'u-text--block' : 'u-text--inline',
|
|
8
|
-
props.lines ? 'u-text--ellipsis' : '',
|
|
8
|
+
props.lines ? 'u-text--ellipsis u-text--block' : '',
|
|
9
9
|
`u-text--align-${props.align}`,
|
|
10
10
|
customClass
|
|
11
11
|
]"
|
|
@@ -206,8 +206,12 @@ const textValueStyle = computed(() => {
|
|
|
206
206
|
: undefined
|
|
207
207
|
};
|
|
208
208
|
if (props.lines) {
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
if (props.lines == 1) {
|
|
210
|
+
style['display'] = 'block';
|
|
211
|
+
} else {
|
|
212
|
+
style['display'] = '-webkit-box';
|
|
213
|
+
style['-webkit-box-orient'] = 'vertical';
|
|
214
|
+
}
|
|
211
215
|
}
|
|
212
216
|
if (!props.type) style.color = props.color;
|
|
213
217
|
if (isNvue.value && props.lines) style.lines = props.lines;
|
|
@@ -23,9 +23,11 @@ export default {
|
|
|
23
23
|
</script>
|
|
24
24
|
|
|
25
25
|
<script setup lang="ts">
|
|
26
|
-
import { ref, computed, watch, onMounted
|
|
27
|
-
import { $u } from '../..';
|
|
26
|
+
import { ref, computed, watch, onMounted } from 'vue';
|
|
28
27
|
import { WaterfallProps } from './types';
|
|
28
|
+
import { useRect, $u } from '../../';
|
|
29
|
+
|
|
30
|
+
const { getRect } = useRect();
|
|
29
31
|
|
|
30
32
|
/**
|
|
31
33
|
* waterfall 瀑布流
|
|
@@ -43,7 +45,6 @@ const props = defineProps(WaterfallProps);
|
|
|
43
45
|
const leftList = ref<any[]>([]);
|
|
44
46
|
const rightList = ref<any[]>([]);
|
|
45
47
|
const tempList = ref<any[]>([]);
|
|
46
|
-
const instance = getCurrentInstance();
|
|
47
48
|
|
|
48
49
|
/**
|
|
49
50
|
* 破坏 flowList 变量的引用,否则 watch 的结果新旧值是一样的
|
|
@@ -67,7 +68,7 @@ onMounted(() => {
|
|
|
67
68
|
* 复制而不是引用对象和数组
|
|
68
69
|
*/
|
|
69
70
|
function cloneData(data: any) {
|
|
70
|
-
return
|
|
71
|
+
return $u.deepClone(data);
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
/**
|
|
@@ -75,8 +76,8 @@ function cloneData(data: any) {
|
|
|
75
76
|
*/
|
|
76
77
|
async function splitData() {
|
|
77
78
|
if (!tempList.value.length) return;
|
|
78
|
-
const leftRect = await
|
|
79
|
-
const rightRect = await
|
|
79
|
+
const leftRect = await getRect('#u-left-column');
|
|
80
|
+
const rightRect = await getRect('#u-right-column');
|
|
80
81
|
// 如果左边小于或等于右边,就添加到左边,否则添加到右边
|
|
81
82
|
const item = tempList.value[0];
|
|
82
83
|
// 解决多次快速上拉后,可能数据会乱的问题,因为经过上面的两个await节点查询阻塞一定时间,加上后面的定时器干扰
|
package/libs/hooks/useRect.ts
CHANGED
|
@@ -6,17 +6,19 @@ import { getCurrentInstance, nextTick, ref } from 'vue';
|
|
|
6
6
|
* @param all 是否获取所有匹配元素
|
|
7
7
|
* @returns rect 响应式的节点信息,refresh 主动刷新方法
|
|
8
8
|
*/
|
|
9
|
-
export function useRect(selector: string, all = false) {
|
|
9
|
+
export function useRect(selector: string = null, all = false) {
|
|
10
10
|
const rect = ref<any>(all ? [] : null);
|
|
11
11
|
const instance = getCurrentInstance();
|
|
12
12
|
|
|
13
|
-
async function
|
|
13
|
+
async function getRect(realSelector: string = null, delay = 0): Promise<any> {
|
|
14
|
+
realSelector = realSelector || selector;
|
|
15
|
+
if (!realSelector) return rect.value;
|
|
14
16
|
await nextTick();
|
|
15
17
|
return new Promise(resolve => {
|
|
16
18
|
setTimeout(() => {
|
|
17
19
|
uni.createSelectorQuery()
|
|
18
20
|
.in(instance?.proxy)
|
|
19
|
-
[all ? 'selectAll' : 'select'](
|
|
21
|
+
[all ? 'selectAll' : 'select'](realSelector)
|
|
20
22
|
.boundingClientRect((res: any) => {
|
|
21
23
|
rect.value = res;
|
|
22
24
|
resolve(res);
|
|
@@ -28,6 +30,6 @@ export function useRect(selector: string, all = false) {
|
|
|
28
30
|
|
|
29
31
|
return {
|
|
30
32
|
rect,
|
|
31
|
-
|
|
33
|
+
getRect
|
|
32
34
|
};
|
|
33
35
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "uview-pro",
|
|
3
3
|
"name": "uview-pro",
|
|
4
4
|
"displayName": "【支持鸿蒙】uView Pro|基于Vue3+TS全面重构的80+精选UI组件库",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.16",
|
|
6
6
|
"description": "uView Pro,是全面支持Vue3的uni-app生态框架,80+精选组件已使用TypeScript重构,已全面支持uni-app Vue3.0",
|
|
7
7
|
"main": "index.ts",
|
|
8
8
|
"module": "index.ts",
|