fix: 修复控制台的一些警告问题
This commit is contained in:
parent
c03db1d1d2
commit
3fcbd54948
|
|
@ -15,6 +15,7 @@
|
|||
"@wangeditor/editor-for-vue": "^5.1.10",
|
||||
"axios": "^0.24.0",
|
||||
"better-scroll": "^2.4.2",
|
||||
"default-passive-events": "^2.0.0",
|
||||
"echarts": "^5.2.2",
|
||||
"element-plus": "^2.1.8",
|
||||
"nprogress": "^0.2.0",
|
||||
|
|
@ -40,12 +41,12 @@
|
|||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-vue": "^8.6.0",
|
||||
"fast-glob": "^3.2.11",
|
||||
"husky": "^7.0.4",
|
||||
"prettier": "^2.6.2",
|
||||
"sass": "^1.43.4",
|
||||
"typescript": "^4.5.4",
|
||||
"vite": "^2.9.7",
|
||||
"fast-glob": "^3.2.11",
|
||||
"vite-plugin-svg-icons": "^2.0.1",
|
||||
"vue-tsc": "^0.34.7"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ watch(show, value => {
|
|||
});
|
||||
|
||||
function addEventClick() {
|
||||
window.addEventListener('click', closeSidebar);
|
||||
window.addEventListener('click', closeSidebar, {passive:true});
|
||||
}
|
||||
|
||||
function closeSidebar(evt: any) {
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import 'element-plus/theme-chalk/index.css';
|
|||
import Pagination from '@/components/Pagination/index.vue';
|
||||
import '@/permission';
|
||||
|
||||
import 'default-passive-events'
|
||||
|
||||
// 引入svg注册脚本
|
||||
import 'virtual:svg-icons-register';
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export default function () {
|
|||
};
|
||||
|
||||
const initResizeEvent = () => {
|
||||
window.addEventListener('resize', chartResizeHandler);
|
||||
window.addEventListener('resize', chartResizeHandler, {passive:true});
|
||||
};
|
||||
|
||||
const destroyResizeEvent = () => {
|
||||
|
|
@ -28,7 +28,8 @@ export default function () {
|
|||
if (sidebarElm.value) {
|
||||
sidebarElm.value.addEventListener(
|
||||
'transitionend',
|
||||
sidebarResizeHandler as EventListener
|
||||
sidebarResizeHandler as EventListener,
|
||||
{passive:true}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue