fix(测试跟踪): 用例列表拖拽模块宽度,点击模块后,宽度恢复了原来的宽度

--bug=1026066 --user=陈建星 【测试跟踪】 github#24300功能用例使用中调整了侧边栏展示的宽度后,再点击具体模块,侧边栏宽度又恢复到了原来的宽度 https://www.tapd.cn/55049933/s/1371141
This commit is contained in:
chenjianxing 2023-05-12 14:45:03 +08:00 committed by fit2-zhao
parent 729d795443
commit 6947c0e827
2 changed files with 5 additions and 2 deletions

View File

@ -22,7 +22,7 @@ export default {
}
.drag-bar:hover {
width: 2px;
width: 4px;
background-color: #783887;
}

View File

@ -107,7 +107,10 @@ export default {
let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver
this.observer = new MutationObserver(() => {
// localStorage
localStorage.setItem(rememberKey, getComputedStyle(element).getPropertyValue('width'));
let width = getComputedStyle(element).getPropertyValue('width');
localStorage.setItem(rememberKey, width);
//
this.defaultWidth = width;
})
this.observer.observe(element, { attributes: true, attributeFilter: ['style'], attributeOldValue: true })
}