xiaosi
1 year ago
2 changed files with 23 additions and 0 deletions
@ -0,0 +1,22 @@ |
|||||
|
import app from '@/app'; |
||||
|
import { OverlayScrollbars } from 'overlayscrollbars'; |
||||
|
|
||||
|
// 滚动条
|
||||
|
app.directive('scrollbar', (el, binding) => { |
||||
|
const { arg: enable } = binding; |
||||
|
if (!enable) return; |
||||
|
const { padding } = binding.modifiers; |
||||
|
console.log(padding); |
||||
|
OverlayScrollbars(el, { |
||||
|
paddingAbsolute: !!padding, |
||||
|
overflow: { |
||||
|
x: 'hidden', |
||||
|
y: 'scroll', |
||||
|
}, |
||||
|
scrollbars: { |
||||
|
theme: 'os-theme-light', |
||||
|
autoHide: 'leave', |
||||
|
autoHideDelay: 300, |
||||
|
}, |
||||
|
}); |
||||
|
}); |
Loading…
Reference in new issue