mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
fix(projects): 添加西瓜视频实例在onUnMounted的销毁,多页签居中距离精确
This commit is contained in:
@ -71,13 +71,13 @@ function setDropdownConfig(x: number, y: number, currentPath: string) {
|
||||
|
||||
// 获取当前激活的tab的clientX
|
||||
const tabRef = ref<HTMLElement | null>(null);
|
||||
async function getActiveChromeTabClientX() {
|
||||
async function getActiveTabClientX() {
|
||||
await nextTick();
|
||||
const index = app.activeMultiTabIndex;
|
||||
if (tabRef.value) {
|
||||
const activeTabElement = tabRef.value.children[index];
|
||||
const { x, width } = activeTabElement.getBoundingClientRect();
|
||||
const clientX = x + width;
|
||||
const clientX = x + width / 2;
|
||||
setTimeout(() => {
|
||||
emit('scroll', clientX);
|
||||
}, 50);
|
||||
@ -103,7 +103,7 @@ useEventListener(window, 'beforeunload', () => {
|
||||
watch(
|
||||
() => app.activeMultiTabIndex,
|
||||
() => {
|
||||
getActiveChromeTabClientX();
|
||||
getActiveTabClientX();
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
|
Reference in New Issue
Block a user