hy-app 0.5.8 → 0.5.10
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/components/hy-action-sheet/index.scss +1 -1
- package/components/hy-address-picker/index.scss +1 -1
- package/components/hy-avatar/index.scss +1 -1
- package/components/hy-back-top/index.scss +1 -1
- package/components/hy-badge/index.scss +1 -1
- package/components/hy-button/index.scss +1 -1
- package/components/hy-calendar/index.scss +1 -1
- package/components/hy-card/hy-card.vue +1 -1
- package/components/hy-card/index.scss +1 -1
- package/components/hy-cell-item/hy-cell-item.vue +1 -0
- package/components/hy-cell-item/index.scss +1 -1
- package/components/hy-check-button/hy-check-button.vue +4 -4
- package/components/hy-checkbox/index.scss +1 -1
- package/components/hy-checkbox-group/index.scss +1 -1
- package/components/hy-checkbox-item/index.scss +1 -1
- package/components/hy-code-input/hy-code-input.vue +1 -1
- package/components/hy-code-input/index.scss +1 -1
- package/components/hy-config-provider/hy-config-provider.vue +4 -2
- package/components/hy-config-provider/index.scss +1 -1
- package/components/hy-count-down/index.scss +1 -1
- package/components/hy-count-to/index.scss +1 -1
- package/components/hy-coupon/index.scss +1 -1
- package/components/hy-datetime-picker/index.scss +1 -1
- package/components/hy-divider/index.scss +1 -1
- package/components/hy-dropdown/index.scss +1 -1
- package/components/hy-dropdown-item/index.scss +1 -1
- package/components/hy-empty/index.scss +1 -1
- package/components/hy-flex/index.scss +1 -1
- package/components/hy-float-button/index.scss +1 -1
- package/components/hy-folding-panel-item/index.scss +1 -1
- package/components/hy-form-item/index.scss +1 -1
- package/components/hy-grid/index.scss +1 -1
- package/components/hy-icon/index.scss +1 -1
- package/components/hy-image/index.scss +1 -1
- package/components/hy-input/hy-input.vue +1 -1
- package/components/hy-input/index.scss +6 -1
- package/components/hy-input/props.ts +1 -1
- package/components/hy-input/typing.d.ts +4 -0
- package/components/hy-line/index.scss +1 -1
- package/components/hy-line-progress/index.scss +2 -1
- package/components/hy-list/index.scss +1 -1
- package/components/hy-loading/index.scss +1 -1
- package/components/hy-menu/index.scss +1 -1
- package/components/hy-modal/index.scss +1 -1
- package/components/hy-navbar/hy-navbar.vue +26 -23
- package/components/hy-navbar/index.scss +2 -2
- package/components/hy-notice-bar/index.scss +1 -1
- package/components/hy-notify/index.scss +1 -1
- package/components/hy-number-step/index.scss +1 -1
- package/components/hy-overlay/index.scss +1 -1
- package/components/hy-pagination/index.scss +1 -1
- package/components/hy-picker/hy-picker.vue +92 -87
- package/components/hy-picker/index.scss +2 -2
- package/components/hy-picker/props.ts +1 -1
- package/components/hy-popover/index.scss +1 -1
- package/components/hy-popup/hy-popup.vue +3 -3
- package/components/hy-popup/index.scss +2 -1
- package/components/hy-price/index.scss +1 -1
- package/components/hy-qrcode/index.scss +1 -1
- package/components/hy-radio/index.scss +1 -1
- package/components/hy-rate/index.scss +1 -1
- package/components/hy-read-more/index.scss +2 -2
- package/components/hy-rolling-num/hy-rolling-num.vue +2 -12
- package/components/hy-rolling-num/index.scss +1 -1
- package/components/hy-scroll-list/index.scss +1 -1
- package/components/hy-search/index.scss +1 -1
- package/components/hy-signature/index.scss +1 -1
- package/components/hy-slider/index.scss +1 -1
- package/components/hy-status-bar/index.scss +1 -1
- package/components/hy-steps/index.scss +1 -1
- package/components/hy-sticky/index.scss +1 -1
- package/components/hy-submit-bar/index.scss +1 -1
- package/components/hy-subsection/index.scss +1 -1
- package/components/hy-swipe-action/index.scss +1 -1
- package/components/hy-swiper/index.scss +2 -2
- package/components/hy-switch/index.scss +1 -1
- package/components/hy-tabbar/index.scss +1 -1
- package/components/hy-tabbar-group/index.scss +1 -1
- package/components/hy-tabbar-item/index.scss +1 -1
- package/components/hy-table/hy-table.vue +358 -0
- package/components/hy-table/index.scss +197 -0
- package/components/hy-table/props.ts +47 -0
- package/components/hy-table/typing.d.ts +34 -0
- package/components/hy-tabs/index.scss +1 -1
- package/components/hy-tag/index.scss +1 -1
- package/components/hy-text/hy-text.vue +1 -1
- package/components/hy-text/index.scss +1 -1
- package/components/hy-textarea/hy-textarea.vue +1 -1
- package/components/hy-textarea/index.scss +6 -1
- package/components/hy-toast/index.scss +2 -1
- package/components/hy-tooltip/index.scss +2 -2
- package/components/hy-upload/index.scss +1 -1
- package/components/hy-warn/hy-warn.vue +2 -2
- package/components/hy-warn/index.scss +1 -1
- package/components/hy-waterfall/index.scss +1 -1
- package/components/hy-watermark/index.scss +1 -1
- package/index.scss +1 -1
- package/libs/css/{mixin.scss → _mixin.scss} +27 -13
- package/libs/css/theme.scss +5 -2
- package/libs/css/vars.scss +6 -0
- package/libs/utils/inside.ts +260 -271
- package/package.json +2 -2
- package/components/hy-rolling-num/README.md +0 -137
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
# hy-rolling-num 滚动数字组件
|
|
2
|
-
|
|
3
|
-
## 介绍
|
|
4
|
-
|
|
5
|
-
滚动数字组件,用于实现数字从初始值(全0)平滑滚动到目标值的动画效果。当数字变化时,会先显示与目标值长度相同的全0字符串,然后通过平滑的滚动动画过渡到目标值。
|
|
6
|
-
|
|
7
|
-
## 特性
|
|
8
|
-
|
|
9
|
-
- 支持自定义数字大小、颜色、字体粗细
|
|
10
|
-
- 支持设置滚动方向(向上、向下、交替)
|
|
11
|
-
- 支持设置动画持续时间和延迟步进
|
|
12
|
-
- 自动根据目标值长度生成对应长度的初始值(全0)
|
|
13
|
-
- 支持特殊字符(非数字字符会直接显示,不会参与滚动)
|
|
14
|
-
|
|
15
|
-
## 使用方法
|
|
16
|
-
|
|
17
|
-
### 基本用法
|
|
18
|
-
|
|
19
|
-
```vue
|
|
20
|
-
<template>
|
|
21
|
-
<view class="demo">
|
|
22
|
-
<hy-rolling-num :value="num" :size="'48rpx'" :color="'#1989fa'" />
|
|
23
|
-
</view>
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<script setup lang="ts">
|
|
27
|
-
import { ref } from 'vue';
|
|
28
|
-
import HyRollingNum from '@/package/components/hy-rolling-num/hy-rolling-num.vue';
|
|
29
|
-
|
|
30
|
-
// 初始值为0,当更新为234564时,会先显示000000然后滚动到234564
|
|
31
|
-
const num = ref(234564);
|
|
32
|
-
</script>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### 自定义配置
|
|
36
|
-
|
|
37
|
-
```vue
|
|
38
|
-
<hy-rolling-num
|
|
39
|
-
:value="num"
|
|
40
|
-
:size="'36rpx'"
|
|
41
|
-
:color="'#ff6b6b'"
|
|
42
|
-
:font-weight="'bold'"
|
|
43
|
-
:duration="2"
|
|
44
|
-
:scroll-direction="'down'"
|
|
45
|
-
:stop-order="'right-to-left'"
|
|
46
|
-
:delay-step="0.15"
|
|
47
|
-
/>
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## Props
|
|
51
|
-
|
|
52
|
-
| 参数名 | 类型 | 默认值 | 说明 |
|
|
53
|
-
|--------|------|--------|------|
|
|
54
|
-
| value | number \| string | 0 | 要显示的数字或字符串值 |
|
|
55
|
-
| size | string | '32rpx' | 数字字体大小 |
|
|
56
|
-
| color | string | '#333' | 数字颜色 |
|
|
57
|
-
| fontWeight | string \| number | 'normal' | 字体粗细 |
|
|
58
|
-
| height | string | '40rpx' | 单个数字的高度 |
|
|
59
|
-
| duration | number | 1.5 | 滚动动画持续时间(秒) |
|
|
60
|
-
| letterSpacing | string | '0' | 数字间距 |
|
|
61
|
-
| scrollDirection | 'up' \| 'down' \| 'alternate' | 'up' | 滚动方向:向上、向下或交替 |
|
|
62
|
-
| stopOrder | 'left-to-right' \| 'right-to-left' | 'left-to-right' | 滚动停止顺序:从左到右或从右到左 |
|
|
63
|
-
| delayStep | number | 0.1 | 每个数字滚动的延迟时间间隔(秒) |
|
|
64
|
-
| customStyle | CSSProperties | {} | 自定义样式对象 |
|
|
65
|
-
|
|
66
|
-
## 示例
|
|
67
|
-
|
|
68
|
-
### 示例1:基本滚动效果
|
|
69
|
-
|
|
70
|
-
```vue
|
|
71
|
-
<template>
|
|
72
|
-
<view>
|
|
73
|
-
<text>滚动数字:</text>
|
|
74
|
-
<hy-rolling-num :value="234564" />
|
|
75
|
-
<!-- 会先显示 000000,然后滚动到 234564 -->
|
|
76
|
-
</view>
|
|
77
|
-
</template>
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### 示例2:改变数字长度
|
|
81
|
-
|
|
82
|
-
```vue
|
|
83
|
-
<template>
|
|
84
|
-
<view>
|
|
85
|
-
<button @click="changeValue(234)">显示 234</button>
|
|
86
|
-
<button @click="changeValue(987654321)">显示 987654321</button>
|
|
87
|
-
<hy-rolling-num :value="displayValue" />
|
|
88
|
-
<!-- 点击第一个按钮:显示 000 -> 234 -->
|
|
89
|
-
<!-- 点击第二个按钮:显示 000000000 -> 987654321 -->
|
|
90
|
-
</view>
|
|
91
|
-
</template>
|
|
92
|
-
|
|
93
|
-
<script setup lang="ts">
|
|
94
|
-
import { ref } from 'vue';
|
|
95
|
-
|
|
96
|
-
const displayValue = ref(0);
|
|
97
|
-
|
|
98
|
-
const changeValue = (val: number) => {
|
|
99
|
-
displayValue.value = val;
|
|
100
|
-
};
|
|
101
|
-
</script>
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### 示例3:自定义滚动方向和动画
|
|
105
|
-
|
|
106
|
-
```vue
|
|
107
|
-
<template>
|
|
108
|
-
<view>
|
|
109
|
-
<hy-rolling-num
|
|
110
|
-
:value="num"
|
|
111
|
-
:scroll-direction="'alternate'"
|
|
112
|
-
:duration="1.2"
|
|
113
|
-
:delay-step="0.08"
|
|
114
|
-
/>
|
|
115
|
-
<!-- 交替方向滚动,奇偶位滚动方向相反 -->
|
|
116
|
-
</view>
|
|
117
|
-
</template>
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
## 注意事项
|
|
121
|
-
|
|
122
|
-
1. 组件会自动根据传入的 `value` 长度生成对应长度的全0初始值
|
|
123
|
-
2. 当 `value` 为字符串时,非数字字符会直接显示,不会参与滚动动画
|
|
124
|
-
3. 滚动动画的实现依赖于CSS的transform属性,确保在支持该属性的环境中使用
|
|
125
|
-
4. 动画延迟时间总和不宜过长,以免影响用户体验
|
|
126
|
-
5. 当需要频繁更新数字时,建议控制更新频率,避免动画效果过于密集
|
|
127
|
-
|
|
128
|
-
## 常见问题
|
|
129
|
-
|
|
130
|
-
### Q: 为什么数字变化时会先显示全0?
|
|
131
|
-
A: 这是组件的设计特性,用于实现从初始状态到目标状态的滚动动画效果,增强视觉体验。
|
|
132
|
-
|
|
133
|
-
### Q: 如何调整滚动速度?
|
|
134
|
-
A: 通过调整 `duration` 属性可以控制整个滚动动画的持续时间,数值越小,滚动越快。
|
|
135
|
-
|
|
136
|
-
### Q: 特殊字符会如何显示?
|
|
137
|
-
A: 非数字字符(如小数点、货币符号等)会直接显示,不会参与滚动动画。
|