mirror of
https://github.com/dataease/dataease.git
synced 2026-06-16 20:42:07 +08:00
fix(仪表板): 样式配置滚动条抖动
This commit is contained in:
@@ -1983,6 +1983,30 @@ const deleteChartFieldItem = id => {
|
||||
fieldLoading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
let directionTop = 0
|
||||
const scrollToTop = debounce(() => {
|
||||
chartStyleRef.value.setScrollTop(directionTop)
|
||||
directionTop = 0
|
||||
}, 10)
|
||||
|
||||
const chartStyleRef = ref()
|
||||
const chartStyleScroll = (val: any) => {
|
||||
if (chartStyleRef.value) {
|
||||
if (directionTop === 0) {
|
||||
directionTop = val.scrollTop
|
||||
}
|
||||
if (val.scrollTop - directionTop > 0) {
|
||||
// 向下滚
|
||||
directionTop = val.scrollTop - 1
|
||||
scrollToTop()
|
||||
} else if (val.scrollTop === 0) {
|
||||
// 向上滚
|
||||
directionTop = 1
|
||||
scrollToTop()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -3291,7 +3315,11 @@ const deleteChartFieldItem = id => {
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-container direction="vertical">
|
||||
<el-scrollbar class="drag_main_area">
|
||||
<el-scrollbar
|
||||
ref="chartStyleRef"
|
||||
@scroll="chartStyleScroll"
|
||||
class="drag_main_area"
|
||||
>
|
||||
<template v-if="view.plugin?.isPlugin">
|
||||
<plugin-component
|
||||
:jsname="view.plugin.staticMap['editor-style']"
|
||||
|
||||
Reference in New Issue
Block a user