import app from '@/app'; import { OverlayScrollbars } from 'overlayscrollbars'; // 滚动条 app.directive('scrollbar', (el, binding) => { const { arg: enable } = binding; if (!enable) return; const { padding } = binding.modifiers; OverlayScrollbars(el, { paddingAbsolute: !!padding, overflow: { x: 'hidden', y: 'scroll', }, scrollbars: { // theme: 'os-theme-light', theme: 'os-theme-dark', autoHide: 'leave', autoHideDelay: 300, }, }); });