hy-app 0.4.7 → 0.4.8
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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="
|
|
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) {
|