perf : 弹框位置调整
This commit is contained in:
@@ -778,12 +778,14 @@ export default {
|
|||||||
if (position.top > clientHeight / 2) {
|
if (position.top > clientHeight / 2) {
|
||||||
labelPosition = {
|
labelPosition = {
|
||||||
left: `${position.left + position.width + leftOffSet}px`,
|
left: `${position.left + position.width + leftOffSet}px`,
|
||||||
top: `${position.top - this.heightList - topOffSetView}px`
|
// top: `${position.top - this.heightList - topOffSetView}px`
|
||||||
|
top: `${position.top - this.heightList - topOffSetView + position.height / 2}px`
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
labelPosition = {
|
labelPosition = {
|
||||||
left: `${position.left + position.width + leftOffSet}px`,
|
left: `${position.left + position.width + leftOffSet}px`,
|
||||||
top: `${position.top + topOffSet}px`
|
// top: `${position.top + topOffSet}px`
|
||||||
|
top: `${position.top + position.height / 2}px`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (position.left > clientWidth / 2) {
|
if (position.left > clientWidth / 2) {
|
||||||
|
|||||||
@@ -124,12 +124,14 @@ export default {
|
|||||||
if (position.top > windowHeight / 2) {
|
if (position.top > windowHeight / 2) {
|
||||||
return {
|
return {
|
||||||
left: `${position.left + position.width + leftOffSetView}px`,
|
left: `${position.left + position.width + leftOffSetView}px`,
|
||||||
top: `${position.top - boxHeight}px`
|
// top: `${position.top - boxHeight}px`
|
||||||
|
top: `${position.top + (position.height / 2) - boxHeight}px`
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
left: `${position.left + position.width + leftOffSetView}px`,
|
left: `${position.left + position.width + leftOffSetView}px`,
|
||||||
top: `${position.top}px`
|
// top: `${position.top}px`
|
||||||
|
top: `${position.top + position.height / 2}px`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user