UNPKG

1.05 kBTypeScriptView Raw
1// eslint-disable-next-line import/no-extraneous-dependencies
2import Vue from 'vue'
3
4declare interface ScrollData {
5 x: number
6 y: number
7}
8
9export interface VueScrollbarProps {
10 /**
11 * If the env is mobile, the component use the native scrollbar
12 *
13 * Require
14 * */
15 isMobile: boolean
16
17 /**
18 * maxHeight of scroll wrap
19 *
20 * Require
21 * */
22 maxHeight: number | string
23
24 /**
25 * Set scrollLeft or scrollTop of scroll wrap
26 *
27 * Value range: 0 ~ 1
28 * */
29 scrollTo?: number | ScrollData
30
31 /**
32 * Set margin of the scrollbar relative to scroll wrap
33 *
34 * Default to 5
35 * */
36 marginToWrap?: number
37}
38
39declare class VueScrollbar extends Vue implements VueScrollbarProps {
40 isMobile: boolean
41
42 maxHeight: number | string
43
44 /** Synchronous effect */
45 scrollTo?: number | ScrollData
46
47 marginToWrap?: number
48
49 /**
50 * Update height of parent element and this.$el
51 * */
52 updateHeight(): void
53
54 /**
55 * Async scroll callback
56 * */
57 $scrollTo(val: number | ScrollData): void
58}
59
60export default VueScrollbar