diff --git a/eslint.config.js b/eslint.config.js index 8f41dd3..08a58fa 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -18,5 +18,8 @@ export default antfu( 'vue/component-definition-name-casing': 'off', }, }, + rules: { + 'no-console': 'off', + }, }, ) diff --git a/src/layouts/components/tab/TabBar.vue b/src/layouts/components/tab/TabBar.vue index 01c8469..fb1eed2 100644 --- a/src/layouts/components/tab/TabBar.vue +++ b/src/layouts/components/tab/TabBar.vue @@ -2,6 +2,7 @@ import type { RouteLocationNormalized } from 'vue-router' import { useAppStore, useTabStore } from '@/store' import { useDraggable } from 'vue-draggable-plus' +import type { NScrollbar } from 'naive-ui' import IconClose from '~icons/icon-park-outline/close' import IconDelete from '~icons/icon-park-outline/delete-four' import IconFullwith from '~icons/icon-park-outline/fullwidth' @@ -103,7 +104,19 @@ function onClickoutside() { } const el = ref() +const scrollbar = ref>() +function onWheel(e: WheelEvent) { + e.preventDefault() + if (Math.abs(e.deltaY) > Math.abs(e.deltaX)) { + e.preventDefault() + console.log('dddwdadad', e.deltaY) + scrollbar.value?.scrollBy({ + left: e.deltaY, + behavior: 'smooth', + }) + } +} useDraggable(el, tabs, { animation: 150, ghostClass: 'ghost', @@ -111,32 +124,34 @@ useDraggable(el, tabs, {