Skip to content

Commit 2cc2c22

Browse files
authored
fix(Tooltip): 修复cloud弹出元素位置问题 (#212)
* 编写选项卡组件 * 类型名称请调整,添加组件文档在网站上展示 * #162修复报错 * fix:#162修复报错 * SpeedDial 悬浮标记 * 优化类型 * feat(ActionSheet): Add new component. * fix: ActionSheet 实例优化,组件优化 * feat(SearchInputBar): Add new component. * feat(Pagination): Add new component. * fix(Tooltip): 修复cloud弹出元素位置问题
1 parent c8e764a commit 2cc2c22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/Tooltip/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function getLocation(
4444
// 得到 三角 x 位置
4545
if (pageOffsetX === (MainWidth - width) / 2) {
4646
isStart = xLocation.center;
47-
style.left = pageOffsetX - 16;
47+
style.left = (MainWidth - _W) / 2 ;
4848
}
4949
if (MainWidth - width - pageOffsetX > pageOffsetX) {
5050
isStart = xLocation.start;
@@ -55,7 +55,7 @@ export function getLocation(
5555
style.left = pageOffsetX - halfWidth + 16;
5656
}
5757
// cloud 宽度超出屏幕
58-
if (_W >= MainWidth - 40) {
58+
if (_W+ pageOffsetX >= MainWidth - 40) {
5959
style.width = MainWidth - 40;
6060
triangle = pageOffsetX + halfWidth - 20 - 10 - 6;
6161
style.left = 20;

0 commit comments

Comments
 (0)