Skip to content

Commit a6b336f

Browse files
committed
fix: tooltip默认值不一致导致的错位问题
1 parent d77ba37 commit a6b336f

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

Diff for: uni_modules/uni-tooltip/changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 0.2.4(2024-04-23)
2+
- 修复 弹出位置默认值不一致导致的错位
13
## 0.2.3(2024-03-20)
24
- 修复 弹出位置修正
35
## 0.2.2(2024-01-15)

Diff for: uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue

+11-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<slot name="content">
66
{{content}}
77
</slot>
8-
</view>
8+
</view>
9+
910
</view>
1011
</template>
1112

@@ -25,8 +26,7 @@
2526
2627
};
2728
},
28-
methods: {
29-
},
29+
methods: {},
3030
computed: {
3131
initPlacement() {
3232
let style = {};
@@ -35,36 +35,36 @@
3535
style = {
3636
top: '50%',
3737
transform: 'translateY(-50%)',
38-
right: '100%',
38+
right: '100%',
3939
"margin-right": '10rpx',
4040
}
4141
break;
4242
case 'right':
4343
style = {
4444
top: '50%',
4545
transform: 'translateY(-50%)',
46-
left: '100%',
46+
left: '100%',
4747
"margin-left": '10rpx',
4848
}
4949
break;
5050
case 'top':
5151
style = {
5252
bottom: '100%',
5353
transform: 'translateX(-50%)',
54-
left: '50%',
54+
left: '50%',
5555
"margin-bottom": '10rpx',
5656
}
5757
break;
5858
case 'bottom':
5959
style = {
6060
top: '100%',
6161
transform: 'translateX(-50%)',
62-
left: '50%',
62+
left: '50%',
6363
"margin-top": '10rpx',
6464
}
6565
break;
6666
}
67-
return style;
67+
return Object.entries(style).map(([key, value]) => `${key}: ${value}`).join('; ');
6868
}
6969
},
7070
props: {
@@ -75,7 +75,7 @@
7575
7676
placement: {
7777
type: String,
78-
default: 'left'
78+
default: 'bottom'
7979
},
8080
}
8181
}
@@ -84,7 +84,7 @@
8484
<style>
8585
.uni-tooltip {
8686
position: relative;
87-
cursor: pointer;
87+
cursor: pointer;
8888
display: inline-block;
8989
}
9090
@@ -98,7 +98,7 @@
9898
font-size: 12px;
9999
text-align: left;
100100
line-height: 16px;
101-
padding: 12px;
101+
padding: 12px;
102102
overflow: auto;
103103
}
104104

Diff for: uni_modules/uni-tooltip/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "uni-tooltip",
33
"displayName": "uni-tooltip 提示文字",
4-
"version": "0.2.3",
4+
"version": "0.2.4",
55
"description": "Tooltip 提示文字",
66
"keywords": [
77
"uni-tooltip",
@@ -43,7 +43,8 @@
4343
"platforms": {
4444
"cloud": {
4545
"tcb": "y",
46-
"aliyun": "y"
46+
"aliyun": "y",
47+
"alipay": "n"
4748
},
4849
"client": {
4950
"Vue": {

0 commit comments

Comments
 (0)