diff --git a/uni_modules/uni-tooltip/changelog.md b/uni_modules/uni-tooltip/changelog.md index 1c6d623b..4c9487ad 100644 --- a/uni_modules/uni-tooltip/changelog.md +++ b/uni_modules/uni-tooltip/changelog.md @@ -1,3 +1,5 @@ +## 0.2.4(2024-04-23) +- 修复 弹出位置默认值不一致导致的错位 ## 0.2.3(2024-03-20) - 修复 弹出位置修正 ## 0.2.2(2024-01-15) diff --git a/uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue b/uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue index 509aaf14..890d767d 100644 --- a/uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue +++ b/uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue @@ -5,7 +5,8 @@ {{content}} - + + @@ -25,8 +26,7 @@ }; }, - methods: { - }, + methods: {}, computed: { initPlacement() { let style = {}; @@ -35,7 +35,7 @@ style = { top: '50%', transform: 'translateY(-50%)', - right: '100%', + right: '100%', "margin-right": '10rpx', } break; @@ -43,7 +43,7 @@ style = { top: '50%', transform: 'translateY(-50%)', - left: '100%', + left: '100%', "margin-left": '10rpx', } break; @@ -51,7 +51,7 @@ style = { bottom: '100%', transform: 'translateX(-50%)', - left: '50%', + left: '50%', "margin-bottom": '10rpx', } break; @@ -59,12 +59,12 @@ style = { top: '100%', transform: 'translateX(-50%)', - left: '50%', + left: '50%', "margin-top": '10rpx', } break; } - return style; + return Object.entries(style).map(([key, value]) => `${key}: ${value}`).join('; '); } }, props: { @@ -75,7 +75,7 @@ placement: { type: String, - default: 'left' + default: 'bottom' }, } } @@ -84,7 +84,7 @@