优化tips和popconfirm的定位

master
yutent 2024-01-17 17:34:52 +08:00
parent 158bd68705
commit 0614910b71
2 changed files with 6 additions and 3 deletions

View File

@ -152,7 +152,11 @@ class PopConfirm extends Component {
placement = 'right' placement = 'right'
styles.left = left + 'px' styles.left = left + 'px'
} else { } else {
let right = window.innerWidth - left + this.clientWidth // 减去小三角形的位移 12px
let right = window.innerWidth - left + this.clientWidth - 12
if (right < 0) {
right = 0
}
styles.right = right + 'px' styles.right = right + 'px'
} }
@ -225,7 +229,6 @@ class PopConfirm extends Component {
>确定</wc-button >确定</wc-button
> >
</footer> </footer>
<i class="trigon"></i>
</div> </div>
</main> </main>
` `

View File

@ -124,7 +124,7 @@ class Tooltip extends Component {
<main class="container"> <main class="container">
<div class="wrapper" ref="wrap"><slot></slot></div> <div class="wrapper" ref="wrap"><slot></slot></div>
<div class="tooltip" ref="tips" #animation=${{}}> <div class="tooltip" ref="tips" #animation=${{}}>
<slot name="title">${this.title}</slot><i class="trigon"></i> <slot name="title">${this.title}</slot>
</div> </div>
</main> </main>
` `