hy-app 0.4.7 → 0.4.9

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 CHANGED
@@ -1,16 +1,24 @@
1
1
  ## 在线使用文档地址
2
- [华玥组件库文档(需要翻墙)](https://hy-component-docs.vercel.app/)
3
- [华玥组件库文档(国内旧地址,2025-11-12之后域名过期)](https://www.gxh151.top)
4
- [华玥组件库文档(国内新地址)](https://www.hy-design-uni.top)
2
+ - [华玥组件库文档(需要翻墙)](https://hy-component-docs.vercel.app/)
3
+ - [华玥组件库文档(国内旧地址,2025-11-12之后域名过期)](https://www.gxh151.top)
4
+ - [华玥组件库文档(国内新地址)](https://www.hy-design-uni.top)
5
5
 
6
- ## H5测试页面地址
7
- [华玥组件库dome(需要翻墙)](https://hy-design-uni.vercel.app/#/)
6
+ ## 📱 移动端预览
7
+ <p style="display:flex;gap:24px">
8
+ <img src="https://pic.imgdd.cc/item/690c01291095cbb336f01f37.png" width="200" height="200" />
9
+ <img src="https://pic.imgdd.cc/item/690c01291095cbb336f01f38.jpg" width="200" height="200" />
10
+ <img src="https://pic.imgdd.cc/item/690c01291095cbb336f01f36.png" width="200" height="200" />
11
+
12
+ </p>
8
13
 
9
14
  ## 安装教程
10
15
 
11
16
  ```angular2html
12
- <!--只支持vue3+uniapp的项目-->
13
- pnpm install hy-app
17
+ <!-- 只支持vue3+uniapp+ts的项目 -->
18
+ pnpm add hy-app
19
+
20
+ <!-- 没有需要下载 -->
21
+ pnpm add dayjs
14
22
 
15
23
  node版本 >= 16.14.*
16
24
  ```
@@ -35,7 +43,7 @@ export function createApp () {
35
43
  </template>
36
44
  ```
37
45
 
38
- ## 在小程序里面配置全局组件
46
+ ## 在page.json文件里面配置按需引入组件
39
47
  ```json
40
48
  {
41
49
  "easycom": {
@@ -44,6 +44,7 @@ import {
44
44
  range,
45
45
  type RectResultType,
46
46
  sleep,
47
+ getPx,
47
48
  } from "../../libs";
48
49
 
49
50
  /**
@@ -7,15 +7,13 @@
7
7
  height: addUnit(getPx(height) + statusBarHeight),
8
8
  }"
9
9
  ></view>
10
- <view
11
- :class="[fixed && 'hy-navbar__fixed']"
12
- :style="{ backgroundColor: bgColor }"
13
- >
10
+ <view :class="[fixed && 'hy-navbar__fixed']">
14
11
  <HyStatusBar v-if="safeAreaInsetTop" :bgColor="bgColor"></HyStatusBar>
15
12
  <view
16
13
  :class="[border && 'hy-border__bottom', 'hy-navbar__content']"
17
14
  :style="{
18
15
  height: addUnit(height),
16
+ backgroundColor: bgColor,
19
17
  }"
20
18
  >
21
19
  <!-- 左边 -->
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
  @include b(navbar) {
6
- @include m(fixed) {
6
+ @include e(fixed) {
7
7
  position: fixed;
8
8
  left: 0;
9
9
  right: 0;
@@ -122,6 +122,7 @@ import {
122
122
  useSlots,
123
123
  watch,
124
124
  inject,
125
+ nextTick,
125
126
  } from "vue";
126
127
  import type { PropType, CSSProperties } from "vue";
127
128
  import type {
@@ -220,7 +221,9 @@ watch(
220
221
  watch(
221
222
  () => props.placement,
222
223
  (newVal) => {
223
- popover.init(newVal, visibleArrow.value, selector);
224
+ nextTick(() => {
225
+ popover.init(newVal, visibleArrow.value, selector);
226
+ });
224
227
  },
225
228
  { immediate: true },
226
229
  );
@@ -251,11 +254,11 @@ watch(
251
254
  },
252
255
  );
253
256
 
254
- onMounted(() => {
255
- setTimeout(() => {
256
- popover.init(props.placement, visibleArrow.value, selector);
257
- }, 2000);
258
- });
257
+ // onMounted(() => {
258
+ // setTimeout(() => {
259
+ // popover.init(props.placement, visibleArrow.value, selector);
260
+ // }, 2000);
261
+ // });
259
262
 
260
263
  onBeforeMount(() => {
261
264
  if (queue && queue.pushToQueue) {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view :class="['hy-tooltip', customClass]" :style="customStyle">
2
+ <view class="hy-tooltip">
3
3
  <HyOverlay
4
4
  :show="showTooltip && tooltipTop !== -10000 && overlay"
5
5
  :customStyle="{ backgroundColor: 'rgba(0, 0, 0, 0)' }"
@@ -7,17 +7,22 @@
7
7
  ></HyOverlay>
8
8
  <!-- 文本内容区域 -->
9
9
  <view
10
- class="hy-tooltip__content"
10
+ :class="`hy-tooltip__content ${customClass}`"
11
11
  id="target"
12
12
  @longpress.stop="longPressHandler"
13
13
  @tap.stop="clickHandler"
14
- :style="{
15
- color: color,
16
- backgroundColor:
17
- bgColor && showTooltip && tooltipTop !== -10000
18
- ? bgColor
19
- : 'transparent',
20
- }"
14
+ :style="[
15
+ {
16
+ color: color,
17
+ fontSize: addUnit(size),
18
+ fontWeight: bold ? 'bold' : '',
19
+ backgroundColor:
20
+ bgColor && showTooltip && tooltipTop !== -10000
21
+ ? bgColor
22
+ : 'transparent',
23
+ },
24
+ customStyle,
25
+ ]"
21
26
  >
22
27
  <slot v-if="$slots.default"></slot>
23
28
  <text class="hy-tooltip__content--text" v-else>{{ text }}</text>
@@ -69,12 +74,14 @@
69
74
  :show="showTooltip"
70
75
  :duration="300"
71
76
  custom-class="hy-tooltip__popup"
72
- :custom-style="popover.popStyle.value"
77
+ :custom-style="{
78
+ ...popover.popStyle.value,
79
+ zIndex: zIndex,
80
+ }"
73
81
  >
74
82
  <view class="hy-tooltip__container">
75
83
  <!-- 三角形 -->
76
84
  <view
77
- v-if="showCopy"
78
85
  :class="`hy-tooltip__arrow ${popover.arrowClass.value}`"
79
86
  :style="popover.arrowStyle.value"
80
87
  ></view>
@@ -150,6 +157,7 @@ import {
150
157
  closeOther,
151
158
  removeFromQueue,
152
159
  pushToQueue,
160
+ addUnit,
153
161
  } from "../../libs";
154
162
 
155
163
  // 组件
@@ -175,11 +183,6 @@ const props = defineProps({
175
183
  type: String,
176
184
  default: "",
177
185
  },
178
- /** 文本大小 */
179
- size: {
180
- type: [String, Number],
181
- default: 14,
182
- },
183
186
  /**
184
187
  * 触发模式
185
188
  * @values longpress,click
@@ -196,21 +199,23 @@ const props = defineProps({
196
199
  type: String as PropType<IPlacementVo>,
197
200
  default: "bottom",
198
201
  },
202
+ /** 文本大小 */
203
+ size: {
204
+ type: [String, Number],
205
+ default: 14,
206
+ },
199
207
  /** 字体颜色 */
200
208
  color: String,
209
+ /** 字体粗细 */
210
+ bold: {
211
+ type: Boolean,
212
+ default: false,
213
+ },
201
214
  /** 弹出提示框时,文本的背景色 */
202
215
  bgColor: {
203
216
  type: String,
204
217
  default: "transparent",
205
218
  },
206
- /**
207
- * 弹出提示的方向
208
- * @values top,bottom
209
- * */
210
- direction: {
211
- type: String,
212
- default: "top",
213
- },
214
219
  /** 弹出提示的z-index,nvue无效 */
215
220
  zIndex: {
216
221
  type: Number,
@@ -233,7 +238,7 @@ const props = defineProps({
233
238
  type: Boolean,
234
239
  default: true,
235
240
  },
236
- /** 是否显示遮罩 */
241
+ /** 是否显示提示 */
237
242
  showToast: {
238
243
  type: Boolean,
239
244
  default: true,
@@ -16,7 +16,6 @@ $hy-tooltip--background-color: rgb(50, 50, 51);
16
16
  background-clip: padding-box;
17
17
  text-align: center;
18
18
  min-height: 36px;
19
- z-index: 99999;
20
19
  transition: opacity 0.2s;
21
20
  box-shadow: $hy-box-shadow;
22
21
  border-radius: $hy-border-radius-sm;
@@ -49,10 +48,6 @@ $hy-tooltip--background-color: rgb(50, 50, 51);
49
48
  /* #ifndef APP-NVUE */
50
49
  white-space: nowrap;
51
50
  /* #endif */
52
-
53
- @include m(text) {
54
- font-size: 28rpx;
55
- }
56
51
  }
57
52
 
58
53
  @include e(container) {
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "hy-app",
3
- "version": "0.4.7",
4
- "description": "fix: 修复tooltip点击无法复制问题",
3
+ "version": "0.4.9",
4
+ "description": "fix: 修复navbar绝对定位问题",
5
5
  "main": "./index.ts",
6
6
  "private": false,
7
7
  "scripts": {},
8
8
  "keywords": [
9
9
  "华玥组件库",
10
- "ui组件库",
10
+ "精美ui",
11
+ "移动端组件库",
12
+ "适配多端小程序",
11
13
  "暗黑模式"
12
14
  ],
13
15
  "web-types": "./web-types.json",