fix(测试跟踪): 用例列表拖拽模块宽度,点击模块后,宽度恢复了原来的宽度
--bug=1026066 --user=陈建星 【测试跟踪】 github#24300功能用例使用中调整了侧边栏展示的宽度后,再点击具体模块,侧边栏宽度又恢复到了原来的宽度 https://www.tapd.cn/55049933/s/1371141
This commit is contained in:
parent
729d795443
commit
6947c0e827
|
@ -22,7 +22,7 @@ export default {
|
|||
}
|
||||
|
||||
.drag-bar:hover {
|
||||
width: 2px;
|
||||
width: 4px;
|
||||
background-color: #783887;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 })
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue