fix(ScrollPane.vue): 新版本el-scrollbarref属性名变动导致addEventListener undefined
Former-commit-id: 1dea3d677c3a2ce362021a4ea1974930310d127f
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
|||||||
computed,
|
computed,
|
||||||
onMounted,
|
onMounted,
|
||||||
onBeforeUnmount,
|
onBeforeUnmount,
|
||||||
getCurrentInstance,
|
getCurrentInstance
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import useStore from '@/store';
|
import useStore from '@/store';
|
||||||
import { TagView } from '@/store/modules/types';
|
import { TagView } from '@/store/modules/types';
|
||||||
@@ -32,7 +32,9 @@ const { tagsView } = useStore();
|
|||||||
|
|
||||||
const visitedViews = computed(() => tagsView.visitedViews);
|
const visitedViews = computed(() => tagsView.visitedViews);
|
||||||
|
|
||||||
const scrollWrapper = computed(() => proxy?.$refs.scrollContainer.$refs.wrap$);
|
const scrollWrapper = computed(
|
||||||
|
() => proxy?.$refs.scrollContainer.$refs.wrapRef
|
||||||
|
);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
scrollWrapper.value.addEventListener('scroll', emitScroll, true);
|
scrollWrapper.value.addEventListener('scroll', emitScroll, true);
|
||||||
@@ -68,7 +70,7 @@ function moveToTarget(currentTag: TagView) {
|
|||||||
} else {
|
} else {
|
||||||
const tagListDom = document.getElementsByClassName('tags-view__item');
|
const tagListDom = document.getElementsByClassName('tags-view__item');
|
||||||
const currentIndex = visitedViews.value.findIndex(
|
const currentIndex = visitedViews.value.findIndex(
|
||||||
(item) => item === currentTag
|
item => item === currentTag
|
||||||
);
|
);
|
||||||
let prevTag = null;
|
let prevTag = null;
|
||||||
let nextTag = null;
|
let nextTag = null;
|
||||||
@@ -107,7 +109,7 @@ function moveToTarget(currentTag: TagView) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
moveToTarget,
|
moveToTarget
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user