提交 1dea3d67 编写于 作者: H haoxr

fix(ScrollPane.vue): 新版本el-scrollbarref属性名变动导致addEventListener undefined

上级 d36f4fb6
...@@ -15,7 +15,7 @@ import { ...@@ -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(); ...@@ -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) { ...@@ -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) { ...@@ -107,7 +109,7 @@ function moveToTarget(currentTag: TagView) {
} }
defineExpose({ defineExpose({
moveToTarget, moveToTarget
}); });
</script> </script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册