|
@@ -15,7 +15,7 @@ import {
|
|
|
const props = defineProps({
|
|
|
maxWidth: { // 文本最大宽度,单位 px
|
|
|
type: [String, Number],
|
|
|
- default: 100
|
|
|
+ default: 240
|
|
|
},
|
|
|
content: { // 展示的内容 string | slot
|
|
|
type: String,
|
|
@@ -252,7 +252,8 @@ async function getPosition() {
|
|
|
}
|
|
|
if (['top', 'bottom'].includes(tooltipPlace.value)) {
|
|
|
top.value = tooltipCardHeight.value + (props.arrow ? 4 + 12 : 6)
|
|
|
- left.value = ((tooltipCardWidth.value - contentWidth.value) / 2) + contentWidth.value.offsetLeft
|
|
|
+ // left.value = ((tooltipCardWidth.value - contentWidth.value) / 2) + contentWidth.value.offsetLeft
|
|
|
+ left.value = (tooltipCardWidth.value - contentWidth.value) / 2
|
|
|
} else {
|
|
|
top.value = (tooltipCardHeight.value - contentHeight.value) / 2
|
|
|
left.value = tooltipCardWidth.value + (props.arrow ? 4 + 12 : 6)
|