fix: 修复控制台的一些警告问题

Former-commit-id: 3fcbd5494858f5af98c64ad6ab8294a7772e69e0
This commit is contained in:
郝先瑞
2022-05-26 00:50:23 +08:00
parent 7669dc66ed
commit fd742634a4
6 changed files with 14 additions and 11 deletions

View File

@@ -35,7 +35,7 @@ const visitedViews = computed(() => tagsView.visitedViews);
const scrollWrapper = computed(() => proxy?.$refs.scrollContainer.$refs.wrap$);
onMounted(() => {
scrollWrapper.value.addEventListener('scroll', emitScroll, true)
scrollWrapper.value.addEventListener('scroll', emitScroll, {passive:true})
})
onBeforeUnmount(() => {
scrollWrapper.value.removeEventListener('scroll', emitScroll)
@@ -81,8 +81,7 @@ function moveToTarget(currentTag: TagView) {
) {
prevTag = tagListDom[k];
}
if (
(tagListDom[k] as any).dataset.path ===
if ((tagListDom[k] as any).dataset.path ===
visitedViews.value[currentIndex + 1].path
) {
nextTag = tagListDom[k];

View File

@@ -8,6 +8,7 @@
<router-link
v-for="tag in visitedViews"
:key="tag.path"
:data-path="tag.path"
:class="isActive(tag) ? 'active' : ''"
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
class="tags-view__item"
@@ -64,8 +65,7 @@ import {
nextTick,
ref,
watch,
onMounted,
ComponentInternalInstance
onMounted
} from 'vue';
import path from 'path-browserify';
@@ -80,7 +80,7 @@ import useStore from '@/store';
const { tagsView, permission } = useStore();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
const route = useRoute();
@@ -108,7 +108,7 @@ watch(
watch(visible, value => {
if (value) {
document.body.addEventListener('click', closeMenu);
document.body.addEventListener('click', closeMenu, {passive:true});
} else {
document.body.removeEventListener('click', closeMenu);
}