├── .browserslistrc ├── .gitignore ├── CHANGELOG.MD ├── LICENSE ├── README.md ├── babel.config.js ├── deploy.sh ├── dist ├── demo.html ├── vueScrollbar.common.js ├── vueScrollbar.common.js.map ├── vueScrollbar.css ├── vueScrollbar.umd.js ├── vueScrollbar.umd.js.map ├── vueScrollbar.umd.min.js └── vueScrollbar.umd.min.js.map ├── docs ├── .vuepress │ ├── components │ │ └── demo-1.vue │ ├── config.js │ └── dist │ │ ├── 404.html │ │ ├── assets │ │ ├── css │ │ │ └── 0.styles.c540165c.css │ │ ├── img │ │ │ ├── azusa.9f24ef4c.jpg │ │ │ └── search.83621669.svg │ │ └── js │ │ │ ├── 10.4d0535e9.js │ │ │ ├── 2.b4f3d6fb.js │ │ │ ├── 3.2563b7af.js │ │ │ ├── 4.a578c752.js │ │ │ ├── 5.9de75006.js │ │ │ ├── 6.d7cf16d8.js │ │ │ ├── 7.8f3a7d09.js │ │ │ ├── 8.c4095d57.js │ │ │ ├── 9.56671dfb.js │ │ │ └── app.0f1956c9.js │ │ ├── en │ │ └── index.html │ │ └── index.html ├── README.md ├── azusa.jpg └── en │ └── README.md ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── favicon.ico └── index.html ├── renovate.json ├── src ├── main.js └── vue-scrollbar.vue ├── vue.config.js └── yarn.lock /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not ie <= 8 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | 4 | # local env files 5 | .env.local 6 | .env.*.local 7 | 8 | # Log files 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | 13 | # Editor directories and files 14 | .idea 15 | .vscode 16 | *.suo 17 | *.ntvs* 18 | *.njsproj 19 | *.sln 20 | *.sw* 21 | -------------------------------------------------------------------------------- /CHANGELOG.MD: -------------------------------------------------------------------------------- 1 | ## 1.4.4 | 2022.04.15 2 | - Add Vite support 3 | 4 | ## 1.4.3 | 2021.12.10 5 | - Update perfect-scrollbar [#68](https://github.com/Binaryify/vue-custom-scrollbar/issues/68) 6 | 7 | ## 1.4.0 | 2020.10.05 8 | - Fixed SSR support error 9 | 10 | - Need import css now ( import "vue-custom-scrollbar/dist/vueScrollbar.css") 11 | 12 | ## 1.3.0 | 2020.08.29 13 | - Update `perfect-scrollbar` to 1.5.0 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018-2022 Binaryify 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-custom-scrollbar 2 | 3 | Vue.JS 的简约但完美的自定义滚动条组件(使用了 [utatti/perfect-scrollbar](https://github.com/utatti/perfect-scrollbar),所以如果遇到某些问题,可以查看 `perfect-scrollbar` 仓库) 4 | 5 | Minimalistic but perfect custom scrollbar component for Vue.JS(using [utatti/perfect-scrollbar](https://github.com/utatti/perfect-scrollbar), so if you have any question, you also can check the `perfect-scrollbar` repo) 6 | 7 | ## 为什么要自定义滚动条/Why custom scrollbar 8 | 9 | 众所周知,谷歌浏览器支持自定义滚动条,但是火狐或其他浏览器不支持,如果你希望你的网站更完美,就用这个组件吧~ 10 | 11 | As you know, Chrome support custom scrollbar, but Firefox or other browsers don't support it, if you want your website perfect, please use this component~ 12 | 13 | ## 为什么要使用 vue-custom-scrollbar?/Why use vue-custom-scrollbar? 14 | 15 | `vue-custom-scrollbar` 是 Vue.JS 的一个简约但完美的自定义滚动条组件 16 | 17 | `vue-custom-scrollbar` is minimalistic but perfect scrollbar component for Vue.JS. 18 | 19 | - 不改变设计布局 / No change on design layout 20 | - 不需要手动操作 DOM / Don't need manipulate DOM manually 21 | - 使用普通的 `scrollTop` and `scrollLeft` / Use plain `scrollTop` and `scrollLeft` 22 | - 滚动条样式可完全自定义 / Scrollbar style is fully customizable 23 | - 布局更改后更新 / Efficient update on layout change 24 | 25 | ## 文档/Docs 26 | 27 | [Docs](https://binaryify.github.io/vue-custom-scrollbar/) 28 | 29 | ## 例子/Example 30 | 31 | ```vue 32 | 39 | 70 | 78 | ``` 79 | 80 | ## License 81 | 82 | [MIT](https://github.com/Binaryify/vue-custom-scrollbar/blob/master/LICENSE) 83 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 确保脚本抛出遇到的错误 4 | set -e 5 | 6 | # 生成静态文件 7 | npm run docs:build 8 | 9 | # 进入生成的文件夹 10 | cd docs/.vuepress/dist 11 | 12 | git init 13 | git add -A 14 | git commit -m 'deploy' 15 | 16 | 17 | # 如果发布到 https://.github.io/ 18 | git push -f git@github.com:binaryify/vue-custom-scrollbar.git master:gh-pages 19 | 20 | cd - -------------------------------------------------------------------------------- /dist/demo.html: -------------------------------------------------------------------------------- 1 | 2 | vueScrollbar demo 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 13 | 14 |
15 | 16 | 32 | 33 | -------------------------------------------------------------------------------- /dist/vueScrollbar.css: -------------------------------------------------------------------------------- 1 | .ps{overflow:hidden!important;overflow-anchor:none;-ms-overflow-style:none;touch-action:auto;-ms-touch-action:auto}.ps__rail-x{height:15px;bottom:0}.ps__rail-x,.ps__rail-y{display:none;opacity:0;transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;position:absolute}.ps__rail-y{width:15px;right:0}.ps--active-x>.ps__rail-x,.ps--active-y>.ps__rail-y{display:block;background-color:transparent}.ps--focus>.ps__rail-x,.ps--focus>.ps__rail-y,.ps--scrolling-x>.ps__rail-x,.ps--scrolling-y>.ps__rail-y,.ps:hover>.ps__rail-x,.ps:hover>.ps__rail-y{opacity:.6}.ps .ps__rail-x.ps--clicking,.ps .ps__rail-x:focus,.ps .ps__rail-x:hover,.ps .ps__rail-y.ps--clicking,.ps .ps__rail-y:focus,.ps .ps__rail-y:hover{background-color:#eee;opacity:.9}.ps__thumb-x{transition:background-color .2s linear,height .2s ease-in-out;-webkit-transition:background-color .2s linear,height .2s ease-in-out;height:6px;bottom:2px}.ps__thumb-x,.ps__thumb-y{background-color:#aaa;border-radius:6px;position:absolute}.ps__thumb-y{transition:background-color .2s linear,width .2s ease-in-out;-webkit-transition:background-color .2s linear,width .2s ease-in-out;width:6px;right:2px}.ps__rail-x.ps--clicking .ps__thumb-x,.ps__rail-x:focus>.ps__thumb-x,.ps__rail-x:hover>.ps__thumb-x{background-color:#999;height:11px}.ps__rail-y.ps--clicking .ps__thumb-y,.ps__rail-y:focus>.ps__thumb-y,.ps__rail-y:hover>.ps__thumb-y{background-color:#999;width:11px}@supports (-ms-overflow-style:none){.ps{overflow:auto!important}}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.ps{overflow:auto!important}}.ps-container{position:relative} -------------------------------------------------------------------------------- /dist/vueScrollbar.umd.min.js: -------------------------------------------------------------------------------- 1 | (function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vueScrollbar"]=e():t["vueScrollbar"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"3ae1":function(t,e,n){"use strict";n("e386")},"7da8":function(t,e,n){},8875:function(t,e,n){var r,i,l;(function(n,o){i=[],r=o,l="function"===typeof r?r.apply(e,i):r,void 0===l||(t.exports=l)})("undefined"!==typeof self&&self,(function(){function t(){var e=Object.getOwnPropertyDescriptor(document,"currentScript");if(!e&&"currentScript"in document&&document.currentScript)return document.currentScript;if(e&&e.get!==t&&document.currentScript)return document.currentScript;try{throw new Error}catch(f){var n,r,i,l=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,o=/@([^@]*):(\d+):(\d+)\s*$/gi,s=l.exec(f.stack)||o.exec(f.stack),a=s&&s[1]||!1,c=s&&s[2]||!1,h=document.location.href.replace(document.location.hash,""),u=document.getElementsByTagName("script");a===h&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(c-2)+"}[^<]* 95 | -------------------------------------------------------------------------------- /docs/.vuepress/config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | base: '/vue-custom-scrollbar/', 3 | themeConfig: { 4 | nav: [ 5 | { 6 | text: 'GitHub', 7 | link: 'https://github.com/Binaryify/vue-custom-scrollbar' 8 | } 9 | ], 10 | sidebar: 'auto', 11 | locales: { 12 | '/': { 13 | label: '中文', 14 | selectText: '选择语言/Languages' 15 | }, 16 | '/en/': { 17 | label: 'English', 18 | selectText: '选择语言/Languages' 19 | } 20 | } 21 | }, 22 | locales: { 23 | // 键名是该语言所属的子路径 24 | // 作为特例,默认语言可以使用 '/' 作为其路径。 25 | '/': { 26 | lang: 'zh-CN', // 将会被设置为 的 lang 属性 27 | description: 'Vue.JS 的迷你但完美的自定义滚动条组件' 28 | }, 29 | '/en/': { 30 | lang: 'en-US', 31 | description: 32 | 'Minimalistic but perfect custom scrollbar component for Vue.JS' 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | VuePress 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |

404

Looks like we've got some broken links.
15 | Take me home. 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/css/0.styles.c540165c.css: -------------------------------------------------------------------------------- 1 | code[class*=language-],pre[class*=language-]{color:#ccc;background:none;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}.theme-default-content code{color:#476582;padding:.25rem .5rem;margin:0;font-size:.85em;background-color:rgba(27,31,35,.05);border-radius:3px}.theme-default-content code .token.deleted{color:#ec5975}.theme-default-content code .token.inserted{color:#3eaf7c}.theme-default-content pre,.theme-default-content pre[class*=language-]{line-height:1.4;padding:1.25rem 1.5rem;margin:.85rem 0;background-color:#282c34;border-radius:6px;overflow:auto}.theme-default-content pre[class*=language-] code,.theme-default-content pre code{color:#fff;padding:0;background-color:transparent;border-radius:0}div[class*=language-]{position:relative;background-color:#282c34;border-radius:6px}div[class*=language-] .highlight-lines{-webkit-user-select:none;-ms-user-select:none;user-select:none;padding-top:1.3rem;position:absolute;top:0;left:0;width:100%;line-height:1.4}div[class*=language-] .highlight-lines .highlighted{background-color:rgba(0,0,0,.66)}div[class*=language-] pre,div[class*=language-] pre[class*=language-]{background:transparent;position:relative;z-index:1}div[class*=language-]:before{position:absolute;z-index:3;top:.8em;right:1em;font-size:.75rem;color:hsla(0,0%,100%,.4)}div[class*=language-]:not(.line-numbers-mode) .line-numbers-wrapper{display:none}div[class*=language-].line-numbers-mode .highlight-lines .highlighted{position:relative}div[class*=language-].line-numbers-mode .highlight-lines .highlighted:before{content:" ";position:absolute;z-index:3;left:0;top:0;display:block;width:3.5rem;height:100%;background-color:rgba(0,0,0,.66)}div[class*=language-].line-numbers-mode pre{padding-left:4.5rem;vertical-align:middle}div[class*=language-].line-numbers-mode .line-numbers-wrapper{position:absolute;top:0;width:3.5rem;text-align:center;color:hsla(0,0%,100%,.3);padding:1.25rem 0;line-height:1.4}div[class*=language-].line-numbers-mode .line-numbers-wrapper br{-webkit-user-select:none;-ms-user-select:none;user-select:none}div[class*=language-].line-numbers-mode .line-numbers-wrapper .line-number{position:relative;z-index:4;-webkit-user-select:none;-ms-user-select:none;user-select:none;font-size:.85em}div[class*=language-].line-numbers-mode:after{content:"";position:absolute;z-index:2;top:0;left:0;width:3.5rem;height:100%;border-radius:6px 0 0 6px;border-right:1px solid rgba(0,0,0,.66);background-color:#282c34}div[class~=language-js]:before{content:"js"}div[class~=language-ts]:before{content:"ts"}div[class~=language-html]:before{content:"html"}div[class~=language-md]:before{content:"md"}div[class~=language-vue]:before{content:"vue"}div[class~=language-css]:before{content:"css"}div[class~=language-sass]:before{content:"sass"}div[class~=language-scss]:before{content:"scss"}div[class~=language-less]:before{content:"less"}div[class~=language-stylus]:before{content:"stylus"}div[class~=language-go]:before{content:"go"}div[class~=language-java]:before{content:"java"}div[class~=language-c]:before{content:"c"}div[class~=language-sh]:before{content:"sh"}div[class~=language-yaml]:before{content:"yaml"}div[class~=language-py]:before{content:"py"}div[class~=language-docker]:before{content:"docker"}div[class~=language-dockerfile]:before{content:"dockerfile"}div[class~=language-makefile]:before{content:"makefile"}div[class~=language-javascript]:before{content:"js"}div[class~=language-typescript]:before{content:"ts"}div[class~=language-markup]:before{content:"html"}div[class~=language-markdown]:before{content:"md"}div[class~=language-json]:before{content:"json"}div[class~=language-ruby]:before{content:"rb"}div[class~=language-python]:before{content:"py"}div[class~=language-bash]:before{content:"sh"}div[class~=language-php]:before{content:"php"}.custom-block .custom-block-title{font-weight:600;margin-bottom:-.4rem}.custom-block.danger,.custom-block.tip,.custom-block.warning{padding:.1rem 1.5rem;border-left-width:.5rem;border-left-style:solid;margin:1rem 0}.custom-block.tip{background-color:#f3f5f7;border-color:#42b983}.custom-block.warning{background-color:rgba(255,229,100,.3);border-color:#e7c000;color:#6b5900}.custom-block.warning .custom-block-title{color:#b29400}.custom-block.warning a{color:#2c3e50}.custom-block.danger{background-color:#ffe6e6;border-color:#c00;color:#4d0000}.custom-block.danger .custom-block-title{color:#900}.custom-block.danger a{color:#2c3e50}.custom-block.details{display:block;position:relative;border-radius:2px;margin:1.6em 0;padding:1.6em;background-color:#eee}.custom-block.details h4{margin-top:0}.custom-block.details figure:last-child,.custom-block.details p:last-child{margin-bottom:0;padding-bottom:0}.custom-block.details summary{outline:none;cursor:pointer}.arrow{display:inline-block;width:0;height:0}.arrow.up{border-bottom:6px solid #ccc}.arrow.down,.arrow.up{border-left:4px solid transparent;border-right:4px solid transparent}.arrow.down{border-top:6px solid #ccc}.arrow.right{border-left:6px solid #ccc}.arrow.left,.arrow.right{border-top:4px solid transparent;border-bottom:4px solid transparent}.arrow.left{border-right:6px solid #ccc}.theme-default-content:not(.custom){max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.theme-default-content:not(.custom){padding:2rem}}@media (max-width:419px){.theme-default-content:not(.custom){padding:1.5rem}}.table-of-contents .badge{vertical-align:middle}body,html{padding:0;margin:0;background-color:#fff}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:16px;color:#2c3e50}.page{padding-left:20rem}.navbar{z-index:20;right:0;height:3.6rem;background-color:#fff;box-sizing:border-box;border-bottom:1px solid #eaecef}.navbar,.sidebar-mask{position:fixed;top:0;left:0}.sidebar-mask{z-index:9;width:100vw;height:100vh;display:none}.sidebar{font-size:16px;background-color:#fff;width:20rem;position:fixed;z-index:10;margin:0;top:3.6rem;left:0;bottom:0;box-sizing:border-box;border-right:1px solid #eaecef;overflow-y:auto}.theme-default-content:not(.custom)>:first-child{margin-top:3.6rem}.theme-default-content:not(.custom) a:hover{text-decoration:underline}.theme-default-content:not(.custom) p.demo{padding:1rem 1.5rem;border:1px solid #ddd;border-radius:4px}.theme-default-content:not(.custom) img{max-width:100%}.theme-default-content.custom{padding:0;margin:0}.theme-default-content.custom img{max-width:100%}a{font-weight:500;text-decoration:none}a,p a code{color:#3eaf7c}p a code{font-weight:400}kbd{background:#eee;border:.15rem solid #ddd;border-bottom:.25rem solid #ddd;border-radius:.15rem;padding:0 .15em}blockquote{font-size:1rem;color:#999;border-left:.2rem solid #dfe2e5;margin:1rem 0;padding:.25rem 0 .25rem 1rem}blockquote>p{margin:0}ol,ul{padding-left:1.2em}strong{font-weight:600}h1,h2,h3,h4,h5,h6{font-weight:600;line-height:1.25}.theme-default-content:not(.custom)>h1,.theme-default-content:not(.custom)>h2,.theme-default-content:not(.custom)>h3,.theme-default-content:not(.custom)>h4,.theme-default-content:not(.custom)>h5,.theme-default-content:not(.custom)>h6{margin-top:-3.1rem;padding-top:4.6rem;margin-bottom:0}.theme-default-content:not(.custom)>h1:first-child,.theme-default-content:not(.custom)>h2:first-child,.theme-default-content:not(.custom)>h3:first-child,.theme-default-content:not(.custom)>h4:first-child,.theme-default-content:not(.custom)>h5:first-child,.theme-default-content:not(.custom)>h6:first-child{margin-top:-1.5rem;margin-bottom:1rem}.theme-default-content:not(.custom)>h1:first-child+.custom-block,.theme-default-content:not(.custom)>h1:first-child+p,.theme-default-content:not(.custom)>h1:first-child+pre,.theme-default-content:not(.custom)>h2:first-child+.custom-block,.theme-default-content:not(.custom)>h2:first-child+p,.theme-default-content:not(.custom)>h2:first-child+pre,.theme-default-content:not(.custom)>h3:first-child+.custom-block,.theme-default-content:not(.custom)>h3:first-child+p,.theme-default-content:not(.custom)>h3:first-child+pre,.theme-default-content:not(.custom)>h4:first-child+.custom-block,.theme-default-content:not(.custom)>h4:first-child+p,.theme-default-content:not(.custom)>h4:first-child+pre,.theme-default-content:not(.custom)>h5:first-child+.custom-block,.theme-default-content:not(.custom)>h5:first-child+p,.theme-default-content:not(.custom)>h5:first-child+pre,.theme-default-content:not(.custom)>h6:first-child+.custom-block,.theme-default-content:not(.custom)>h6:first-child+p,.theme-default-content:not(.custom)>h6:first-child+pre{margin-top:2rem}h1:hover .header-anchor,h2:hover .header-anchor,h3:hover .header-anchor,h4:hover .header-anchor,h5:hover .header-anchor,h6:hover .header-anchor{opacity:1}h1{font-size:2.2rem}h2{font-size:1.65rem;padding-bottom:.3rem;border-bottom:1px solid #eaecef}h3{font-size:1.35rem}a.header-anchor{font-size:.85em;float:left;margin-left:-.87em;padding-right:.23em;margin-top:.125em;opacity:0}a.header-anchor:hover{text-decoration:none}.line-number,code,kbd{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}ol,p,ul{line-height:1.7}hr{border:0;border-top:1px solid #eaecef}table{border-collapse:collapse;margin:1rem 0;display:block;overflow-x:auto}tr{border-top:1px solid #dfe2e5}tr:nth-child(2n){background-color:#f6f8fa}td,th{border:1px solid #dfe2e5;padding:.6em 1em}.theme-container.sidebar-open .sidebar-mask{display:block}.theme-container.no-navbar .theme-default-content:not(.custom)>h1,.theme-container.no-navbar h2,.theme-container.no-navbar h3,.theme-container.no-navbar h4,.theme-container.no-navbar h5,.theme-container.no-navbar h6{margin-top:1.5rem;padding-top:0}.theme-container.no-navbar .sidebar{top:0}@media (min-width:720px){.theme-container.no-sidebar .sidebar{display:none}.theme-container.no-sidebar .page{padding-left:0}}@media (max-width:959px){.sidebar{font-size:15px;width:16.4rem}.page{padding-left:16.4rem}}@media (max-width:719px){.sidebar{top:0;padding-top:3.6rem;transform:translateX(-100%);transition:transform .2s ease}.page{padding-left:0}.theme-container.sidebar-open .sidebar{transform:translateX(0)}.theme-container.no-navbar .sidebar{padding-top:0}}@media (max-width:419px){h1{font-size:1.9rem}.theme-default-content div[class*=language-]{margin:.85rem -1.5rem;border-radius:0}}#nprogress{pointer-events:none}#nprogress .bar{background:#3eaf7c;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;-webkit-box-shadow:0 0 10px #3eaf7c,0 0 5px #3eaf7c;box-shadow:0 0 10px #3eaf7c,0 0 5px #3eaf7c;opacity:1;-webkit-transform:rotate(3deg) translateY(-4px);transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;-webkit-box-sizing:border-box;box-sizing:border-box;border-color:#3eaf7c transparent transparent #3eaf7c;border-style:solid;border-width:2px;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.icon.outbound{color:#aaa;display:inline-block;vertical-align:middle;position:relative;top:-1px}.home{padding:3.6rem 2rem 0;max-width:960px;margin:0 auto;display:block}.home .hero{text-align:center}.home .hero img{max-width:100%;max-height:280px;display:block;margin:3rem auto 1.5rem}.home .hero h1{font-size:3rem}.home .hero .action,.home .hero .description,.home .hero h1{margin:1.8rem auto}.home .hero .description{max-width:35rem;font-size:1.6rem;line-height:1.3;color:#6a8bad}.home .hero .action-button{display:inline-block;font-size:1.2rem;color:#fff;background-color:#3eaf7c;padding:.8rem 1.6rem;border-radius:4px;-webkit-transition:background-color .1s ease;transition:background-color .1s ease;-webkit-box-sizing:border-box;box-sizing:border-box;border-bottom:1px solid #389d70}.home .hero .action-button:hover{background-color:#4abf8a}.home .features{border-top:1px solid #eaecef;padding:1.2rem 0;margin-top:2.5rem;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-ms-flex-line-pack:stretch;align-content:stretch;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.home .feature{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-preferred-size:30%;flex-basis:30%;max-width:30%}.home .feature h2{font-size:1.4rem;font-weight:500;border-bottom:none;padding-bottom:0;color:#3a5169}.home .feature p{color:#4e6e8e}.home .footer{padding:2.5rem;border-top:1px solid #eaecef;text-align:center;color:#4e6e8e}@media (max-width:719px){.home .features{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.home .feature{max-width:100%;padding:0 2.5rem}}@media (max-width:419px){.home{padding-left:1.5rem;padding-right:1.5rem}.home .hero img{max-height:210px;margin:2rem auto 1.2rem}.home .hero h1{font-size:2rem}.home .hero .action,.home .hero .description,.home .hero h1{margin:1.2rem auto}.home .hero .description{font-size:1.2rem}.home .hero .action-button{font-size:1rem;padding:.6rem 1.2rem}.home .feature h2{font-size:1.25rem}}.search-box{display:inline-block;position:relative;margin-right:1rem}.search-box input{cursor:text;width:10rem;height:2rem;color:#4e6e8e;display:inline-block;border:1px solid #cfd4db;border-radius:2rem;font-size:.9rem;line-height:2rem;padding:0 .5rem 0 2rem;outline:none;-webkit-transition:all .2s ease;transition:all .2s ease;background:#fff url(/vue-custom-scrollbar/assets/img/search.83621669.svg) .6rem .5rem no-repeat;background-size:1rem}.search-box input:focus{cursor:auto;border-color:#3eaf7c}.search-box .suggestions{background:#fff;width:20rem;position:absolute;top:2rem;border:1px solid #cfd4db;border-radius:6px;padding:.4rem;list-style-type:none}.search-box .suggestions.align-right{right:0}.search-box .suggestion{line-height:1.4;padding:.4rem .6rem;border-radius:4px;cursor:pointer}.search-box .suggestion a{white-space:normal;color:#5d82a6}.search-box .suggestion a .page-title{font-weight:600}.search-box .suggestion a .header{font-size:.9em;margin-left:.25em}.search-box .suggestion.focused{background-color:#f3f4f5}.search-box .suggestion.focused a{color:#3eaf7c}@media (max-width:959px){.search-box input{cursor:pointer;width:0;border-color:transparent;position:relative}.search-box input:focus{cursor:text;left:0;width:10rem}}@media (-ms-high-contrast:none){.search-box input{height:2rem}}@media (max-width:959px) and (min-width:719px){.search-box .suggestions{left:0}}@media (max-width:719px){.search-box{margin-right:0}.search-box input{left:1rem}.search-box .suggestions{right:0}}@media (max-width:419px){.search-box .suggestions{width:calc(100vw - 4rem)}.search-box input:focus{width:8rem}}.sidebar-button{cursor:pointer;display:none;width:1.25rem;height:1.25rem;position:absolute;padding:.6rem;top:.6rem;left:1rem}.sidebar-button .icon{display:block;width:1.25rem;height:1.25rem}@media (max-width:719px){.sidebar-button{display:block}}.dropdown-enter,.dropdown-leave-to{height:0!important}.dropdown-wrapper{cursor:pointer}.dropdown-wrapper .dropdown-title,.dropdown-wrapper .mobile-dropdown-title{display:block;font-size:.9rem;font-family:inherit;cursor:inherit;padding:inherit;line-height:1.4rem;background:transparent;border:none;font-weight:500;color:#2c3e50}.dropdown-wrapper .dropdown-title:hover,.dropdown-wrapper .mobile-dropdown-title:hover{border-color:transparent}.dropdown-wrapper .dropdown-title .arrow,.dropdown-wrapper .mobile-dropdown-title .arrow{vertical-align:middle;margin-top:-1px;margin-left:.4rem}.dropdown-wrapper .mobile-dropdown-title{display:none;font-weight:600}.dropdown-wrapper .mobile-dropdown-title font-size inherit:hover{color:#3eaf7c}.dropdown-wrapper .nav-dropdown .dropdown-item{color:inherit;line-height:1.7rem}.dropdown-wrapper .nav-dropdown .dropdown-item h4{margin:.45rem 0 0;border-top:1px solid #eee;padding:1rem 1.5rem .45rem 1.25rem}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem-wrapper{padding:0;list-style:none}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem-wrapper .dropdown-subitem{font-size:.9em}.dropdown-wrapper .nav-dropdown .dropdown-item a{display:block;line-height:1.7rem;position:relative;border-bottom:none;font-weight:400;margin-bottom:0;padding:0 1.5rem 0 1.25rem}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active,.dropdown-wrapper .nav-dropdown .dropdown-item a:hover{color:#3eaf7c}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{content:"";width:0;height:0;border-left:5px solid #3eaf7c;border-top:3px solid transparent;border-bottom:3px solid transparent;position:absolute;top:calc(50% - 2px);left:9px}.dropdown-wrapper .nav-dropdown .dropdown-item:first-child h4{margin-top:0;padding-top:0;border-top:0}@media (max-width:719px){.dropdown-wrapper.open .dropdown-title{margin-bottom:.5rem}.dropdown-wrapper .dropdown-title{display:none}.dropdown-wrapper .mobile-dropdown-title{display:block}.dropdown-wrapper .nav-dropdown{-webkit-transition:height .1s ease-out;transition:height .1s ease-out;overflow:hidden}.dropdown-wrapper .nav-dropdown .dropdown-item h4{border-top:0;margin-top:0;padding-top:0}.dropdown-wrapper .nav-dropdown .dropdown-item>a,.dropdown-wrapper .nav-dropdown .dropdown-item h4{font-size:15px;line-height:2rem}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem{font-size:14px;padding-left:1rem}}@media (min-width:719px){.dropdown-wrapper{height:1.8rem}.dropdown-wrapper.open .nav-dropdown,.dropdown-wrapper:hover .nav-dropdown{display:block!important}.dropdown-wrapper.open:blur{display:none}.dropdown-wrapper .nav-dropdown{display:none;height:auto!important;-webkit-box-sizing:border-box;box-sizing:border-box;max-height:calc(100vh - 2.7rem);overflow-y:auto;position:absolute;top:100%;right:0;background-color:#fff;padding:.6rem 0;border:1px solid;border-color:#ddd #ddd #ccc;text-align:left;border-radius:.25rem;white-space:nowrap;margin:0}}.nav-links{display:inline-block}.nav-links a{line-height:1.4rem;color:inherit}.nav-links a.router-link-active,.nav-links a:hover{color:#3eaf7c}.nav-links .nav-item{position:relative;display:inline-block;margin-left:1.5rem;line-height:2rem}.nav-links .nav-item:first-child{margin-left:0}.nav-links .repo-link{margin-left:1.5rem}@media (max-width:719px){.nav-links .nav-item,.nav-links .repo-link{margin-left:0}}@media (min-width:719px){.nav-links a.router-link-active,.nav-links a:hover{color:#2c3e50}.nav-item>a:not(.external).router-link-active,.nav-item>a:not(.external):hover{margin-bottom:-2px;border-bottom:2px solid #46bd87}}.navbar{padding:.7rem 1.5rem;line-height:2.2rem}.navbar a,.navbar img,.navbar span{display:inline-block}.navbar .logo{height:2.2rem;min-width:2.2rem;margin-right:.8rem;vertical-align:top}.navbar .site-name{font-size:1.3rem;font-weight:600;color:#2c3e50;position:relative}.navbar .links{padding-left:1.5rem;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#fff;white-space:nowrap;font-size:.9rem;position:absolute;right:1.5rem;top:.7rem;display:-webkit-box;display:-ms-flexbox;display:flex}.navbar .links .search-box{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;vertical-align:top}@media (max-width:719px){.navbar{padding-left:4rem}.navbar .can-hide{display:none}.navbar .links{padding-left:1.5rem}.navbar .site-name{width:calc(100vw - 9.4rem);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}}.page-edit{max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.page-edit{padding:2rem}}@media (max-width:419px){.page-edit{padding:1.5rem}}.page-edit{padding-top:1rem;padding-bottom:1rem;overflow:auto}.page-edit .edit-link{display:inline-block}.page-edit .edit-link a{color:#4e6e8e;margin-right:.25rem}.page-edit .last-updated{float:right;font-size:.9em}.page-edit .last-updated .prefix{font-weight:500;color:#4e6e8e}.page-edit .last-updated .time{font-weight:400;color:#767676}@media (max-width:719px){.page-edit .edit-link{margin-bottom:.5rem}.page-edit .last-updated{font-size:.8em;float:none;text-align:left}}.page-nav{max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.page-nav{padding:2rem}}@media (max-width:419px){.page-nav{padding:1.5rem}}.page-nav{padding-top:1rem;padding-bottom:0}.page-nav .inner{min-height:2rem;margin-top:0;border-top:1px solid #eaecef;padding-top:1rem;overflow:auto}.page-nav .next{float:right}.page{padding-bottom:2rem;display:block}.sidebar-group .sidebar-group{padding-left:.5em}.sidebar-group:not(.collapsable) .sidebar-heading:not(.clickable){cursor:auto;color:inherit}.sidebar-group.is-sub-group{padding-left:0}.sidebar-group.is-sub-group>.sidebar-heading{font-size:.95em;line-height:1.4;font-weight:400;padding-left:2rem}.sidebar-group.is-sub-group>.sidebar-heading:not(.clickable){opacity:.5}.sidebar-group.is-sub-group>.sidebar-group-items{padding-left:1rem}.sidebar-group.is-sub-group>.sidebar-group-items>li>.sidebar-link{font-size:.95em;border-left:none}.sidebar-group.depth-2>.sidebar-heading{border-left:none}.sidebar-heading{color:#2c3e50;-webkit-transition:color .15s ease;transition:color .15s ease;cursor:pointer;font-size:1.1em;font-weight:700;padding:.35rem 1.5rem .35rem 1.25rem;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;border-left:.25rem solid transparent}.sidebar-heading.open,.sidebar-heading:hover{color:inherit}.sidebar-heading .arrow{position:relative;top:-.12em;left:.5em}.sidebar-heading.clickable.active{font-weight:600;color:#3eaf7c;border-left-color:#3eaf7c}.sidebar-heading.clickable:hover{color:#3eaf7c}.sidebar-group-items{-webkit-transition:height .1s ease-out;transition:height .1s ease-out;font-size:.95em;overflow:hidden}.sidebar .sidebar-sub-headers{padding-left:1rem;font-size:.95em}a.sidebar-link{font-size:1em;font-weight:400;display:inline-block;color:#2c3e50;border-left:.25rem solid transparent;padding:.35rem 1rem .35rem 1.25rem;line-height:1.4;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}a.sidebar-link:hover{color:#3eaf7c}a.sidebar-link.active{font-weight:600;color:#3eaf7c;border-left-color:#3eaf7c}.sidebar-group a.sidebar-link{padding-left:2rem}.sidebar-sub-headers a.sidebar-link{padding-top:.25rem;padding-bottom:.25rem;border-left:none}.sidebar-sub-headers a.sidebar-link.active{font-weight:500}.sidebar ul{padding:0;margin:0;list-style-type:none}.sidebar a{display:inline-block}.sidebar .nav-links{display:none;border-bottom:1px solid #eaecef;padding:.5rem 0 .75rem}.sidebar .nav-links a{font-weight:600}.sidebar .nav-links .nav-item,.sidebar .nav-links .repo-link{display:block;line-height:1.25rem;font-size:1.1em;padding:.5rem 0 .5rem 1.5rem}.sidebar>.sidebar-links{padding:1.5rem 0}.sidebar>.sidebar-links>li>a.sidebar-link{font-size:1.1em;line-height:1.7;font-weight:700}.sidebar>.sidebar-links>li:not(:first-child){margin-top:.75rem}@media (max-width:719px){.sidebar .nav-links{display:block}.sidebar .nav-links .dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{top:calc(1rem - 2px)}.sidebar>.sidebar-links{padding:1rem 0}}.ps{overflow:hidden!important;overflow-anchor:none;-ms-overflow-style:none;touch-action:auto;-ms-touch-action:auto}.ps__rail-x{height:15px;bottom:0}.ps__rail-x,.ps__rail-y{display:none;opacity:0;transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;position:absolute}.ps__rail-y{width:15px;right:0}.ps--active-x>.ps__rail-x,.ps--active-y>.ps__rail-y{display:block;background-color:transparent}.ps--focus>.ps__rail-x,.ps--focus>.ps__rail-y,.ps--scrolling-x>.ps__rail-x,.ps--scrolling-y>.ps__rail-y,.ps:hover>.ps__rail-x,.ps:hover>.ps__rail-y{opacity:.6}.ps .ps__rail-x.ps--clicking,.ps .ps__rail-x:focus,.ps .ps__rail-x:hover,.ps .ps__rail-y.ps--clicking,.ps .ps__rail-y:focus,.ps .ps__rail-y:hover{background-color:#eee;opacity:.9}.ps__thumb-x{transition:background-color .2s linear,height .2s ease-in-out;-webkit-transition:background-color .2s linear,height .2s ease-in-out;height:6px;bottom:2px}.ps__thumb-x,.ps__thumb-y{background-color:#aaa;border-radius:6px;position:absolute}.ps__thumb-y{transition:background-color .2s linear,width .2s ease-in-out;-webkit-transition:background-color .2s linear,width .2s ease-in-out;width:6px;right:2px}.ps__rail-x.ps--clicking .ps__thumb-x,.ps__rail-x:focus>.ps__thumb-x,.ps__rail-x:hover>.ps__thumb-x{background-color:#999;height:11px}.ps__rail-y.ps--clicking .ps__thumb-y,.ps__rail-y:focus>.ps__thumb-y,.ps__rail-y:hover>.ps__thumb-y{background-color:#999;width:11px}@supports (-ms-overflow-style:none){.ps{overflow:auto!important}}@media (-ms-high-contrast:none),screen and (-ms-high-contrast:active){.ps{overflow:auto!important}}.ps-container,.scroll-area{position:relative}.scroll-area{margin:auto}.scroll-area .demoImg{background-image:url(/vue-custom-scrollbar/assets/img/azusa.9f24ef4c.jpg);width:1280px;height:720px}.badge[data-v-c922b936]{display:inline-block;font-size:14px;height:18px;line-height:18px;border-radius:3px;padding:0 6px;color:#fff}.badge.green[data-v-c922b936],.badge.tip[data-v-c922b936],.badge[data-v-c922b936]{background-color:#42b983}.badge.error[data-v-c922b936]{background-color:#da5961}.badge.warn[data-v-c922b936],.badge.warning[data-v-c922b936],.badge.yellow[data-v-c922b936]{background-color:#e7c000}.badge+.badge[data-v-c922b936]{margin-left:5px}.theme-code-block[data-v-3b51d646]{display:none}.theme-code-block__active[data-v-3b51d646]{display:block}.theme-code-block>pre[data-v-3b51d646]{background-color:orange}.theme-code-group__nav[data-v-02730c6e]{margin-bottom:-35px;background-color:#282c34;padding-bottom:22px;border-top-left-radius:6px;border-top-right-radius:6px;padding-left:10px;padding-top:10px}.theme-code-group__nav-tab[data-v-02730c6e]{border:0;padding:5px;cursor:pointer;background-color:transparent;font-size:.85em;line-height:1.4;color:hsla(0,0%,100%,.9);font-weight:600}.theme-code-group__nav-tab-active[data-v-02730c6e]{border-bottom:1px solid #42b983}.pre-blank[data-v-02730c6e]{color:#42b983} -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/img/azusa.9f24ef4c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Binaryify/vue-custom-scrollbar/989eb98a8b97b3547fbd87e8816777dbd568544f/docs/.vuepress/dist/assets/img/azusa.9f24ef4c.jpg -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/img/search.83621669.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/js/10.4d0535e9.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[10],{346:function(t,e,i){"use strict"; 2 | /*! 3 | * perfect-scrollbar v1.5.0 4 | * Copyright 2020 Hyunje Jun, MDBootstrap and Contributors 5 | * Licensed under MIT 6 | */function r(t){return getComputedStyle(t)}function l(t,e){for(var i in e){var r=e[i];"number"==typeof r&&(r+="px"),t.style[i]=r}return t}function n(t){var e=document.createElement("div");return e.className=t,e}var o="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function s(t,e){if(!o)throw new Error("No element matching method supported");return o.call(t,e)}function a(t){t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)}function c(t,e){return Array.prototype.filter.call(t.children,(function(t){return s(t,e)}))}var h="ps",u="ps__rtl",d={thumb:function(t){return"ps__thumb-"+t},rail:function(t){return"ps__rail-"+t},consuming:"ps__child--consume"},f={focus:"ps--focus",clicking:"ps--clicking",active:function(t){return"ps--active-"+t},scrolling:function(t){return"ps--scrolling-"+t}},p={x:null,y:null};function b(t,e){var i=t.element.classList,r=f.scrolling(e);i.contains(r)?clearTimeout(p[e]):i.add(r)}function g(t,e){p[e]=setTimeout((function(){return t.isAlive&&t.element.classList.remove(f.scrolling(e))}),t.settings.scrollingThreshold)}var v=function(t){this.element=t,this.handlers={}},m={isEmpty:{configurable:!0}};v.prototype.bind=function(t,e){void 0===this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e),this.element.addEventListener(t,e,!1)},v.prototype.unbind=function(t,e){var i=this;this.handlers[t]=this.handlers[t].filter((function(r){return!(!e||r===e)||(i.element.removeEventListener(t,r,!1),!1)}))},v.prototype.unbindAll=function(){for(var t in this.handlers)this.unbind(t)},m.isEmpty.get=function(){var t=this;return Object.keys(this.handlers).every((function(e){return 0===t.handlers[e].length}))},Object.defineProperties(v.prototype,m);var Y=function(){this.eventElements=[]};function w(t){if("function"==typeof window.CustomEvent)return new CustomEvent(t);var e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,void 0),e}function X(t,e,i,r,l){var n;if(void 0===r&&(r=!0),void 0===l&&(l=!1),"top"===e)n=["contentHeight","containerHeight","scrollTop","y","up","down"];else{if("left"!==e)throw new Error("A proper axis should be provided");n=["contentWidth","containerWidth","scrollLeft","x","left","right"]}!function(t,e,i,r,l){var n=i[0],o=i[1],s=i[2],a=i[3],c=i[4],h=i[5];void 0===r&&(r=!0);void 0===l&&(l=!1);var u=t.element;t.reach[a]=null,u[s]<1&&(t.reach[a]="start");u[s]>t[n]-t[o]-1&&(t.reach[a]="end");e&&(u.dispatchEvent(w("ps-scroll-"+a)),e<0?u.dispatchEvent(w("ps-scroll-"+c)):e>0&&u.dispatchEvent(w("ps-scroll-"+h)),r&&function(t,e){b(t,e),g(t,e)}(t,a));t.reach[a]&&(e||l)&&u.dispatchEvent(w("ps-"+a+"-reach-"+t.reach[a]))}(t,i,n,r,l)}function W(t){return parseInt(t,10)||0}Y.prototype.eventElement=function(t){var e=this.eventElements.filter((function(e){return e.element===t}))[0];return e||(e=new v(t),this.eventElements.push(e)),e},Y.prototype.bind=function(t,e,i){this.eventElement(t).bind(e,i)},Y.prototype.unbind=function(t,e,i){var r=this.eventElement(t);r.unbind(e,i),r.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(r),1)},Y.prototype.unbindAll=function(){this.eventElements.forEach((function(t){return t.unbindAll()})),this.eventElements=[]},Y.prototype.once=function(t,e,i){var r=this.eventElement(t),l=function(t){r.unbind(e,l),i(t)};r.bind(e,l)};var y={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)};function L(t){var e=t.element,i=Math.floor(e.scrollTop),r=e.getBoundingClientRect();t.containerWidth=Math.ceil(r.width),t.containerHeight=Math.ceil(r.height),t.contentWidth=e.scrollWidth,t.contentHeight=e.scrollHeight,e.contains(t.scrollbarXRail)||(c(e,d.rail("x")).forEach((function(t){return a(t)})),e.appendChild(t.scrollbarXRail)),e.contains(t.scrollbarYRail)||(c(e,d.rail("y")).forEach((function(t){return a(t)})),e.appendChild(t.scrollbarYRail)),!t.settings.suppressScrollX&&t.containerWidth+t.settings.scrollXMarginOffset=t.railXWidth-t.scrollbarXWidth&&(t.scrollbarXLeft=t.railXWidth-t.scrollbarXWidth),t.scrollbarYTop>=t.railYHeight-t.scrollbarYHeight&&(t.scrollbarYTop=t.railYHeight-t.scrollbarYHeight),function(t,e){var i={width:e.railXWidth},r=Math.floor(t.scrollTop);e.isRtl?i.left=e.negativeScrollAdjustment+t.scrollLeft+e.containerWidth-e.contentWidth:i.left=t.scrollLeft;e.isScrollbarXUsingBottom?i.bottom=e.scrollbarXBottom-r:i.top=e.scrollbarXTop+r;l(e.scrollbarXRail,i);var n={top:r,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?n.right=e.contentWidth-(e.negativeScrollAdjustment+t.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth-9:n.right=e.scrollbarYRight-t.scrollLeft:e.isRtl?n.left=e.negativeScrollAdjustment+t.scrollLeft+2*e.containerWidth-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:n.left=e.scrollbarYLeft+t.scrollLeft;l(e.scrollbarYRail,n),l(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),l(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}(e,t),t.scrollbarXActive?e.classList.add(f.active("x")):(e.classList.remove(f.active("x")),t.scrollbarXWidth=0,t.scrollbarXLeft=0,e.scrollLeft=!0===t.isRtl?t.contentWidth:0),t.scrollbarYActive?e.classList.add(f.active("y")):(e.classList.remove(f.active("y")),t.scrollbarYHeight=0,t.scrollbarYTop=0,e.scrollTop=0)}function R(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function T(t,e){var i=e[0],r=e[1],l=e[2],n=e[3],o=e[4],s=e[5],a=e[6],c=e[7],h=e[8],u=t.element,d=null,p=null,v=null;function m(e){e.touches&&e.touches[0]&&(e[l]=e.touches[0].pageY),u[a]=d+v*(e[l]-p),b(t,c),L(t),e.stopPropagation(),e.preventDefault()}function Y(){g(t,c),t[h].classList.remove(f.clicking),t.event.unbind(t.ownerDocument,"mousemove",m)}function w(e,o){d=u[a],o&&e.touches&&(e[l]=e.touches[0].pageY),p=e[l],v=(t[r]-t[i])/(t[n]-t[s]),o?t.event.bind(t.ownerDocument,"touchmove",m):(t.event.bind(t.ownerDocument,"mousemove",m),t.event.once(t.ownerDocument,"mouseup",Y),e.preventDefault()),t[h].classList.add(f.clicking),e.stopPropagation()}t.event.bind(t[o],"mousedown",(function(t){w(t)})),t.event.bind(t[o],"touchstart",(function(t){w(t,!0)}))}var H={"click-rail":function(t){t.element,t.event.bind(t.scrollbarY,"mousedown",(function(t){return t.stopPropagation()})),t.event.bind(t.scrollbarYRail,"mousedown",(function(e){var i=e.pageY-window.pageYOffset-t.scrollbarYRail.getBoundingClientRect().top>t.scrollbarYTop?1:-1;t.element.scrollTop+=i*t.containerHeight,L(t),e.stopPropagation()})),t.event.bind(t.scrollbarX,"mousedown",(function(t){return t.stopPropagation()})),t.event.bind(t.scrollbarXRail,"mousedown",(function(e){var i=e.pageX-window.pageXOffset-t.scrollbarXRail.getBoundingClientRect().left>t.scrollbarXLeft?1:-1;t.element.scrollLeft+=i*t.containerWidth,L(t),e.stopPropagation()}))},"drag-thumb":function(t){T(t,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),T(t,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(t){var e=t.element;t.event.bind(t.ownerDocument,"keydown",(function(i){if(!(i.isDefaultPrevented&&i.isDefaultPrevented()||i.defaultPrevented)&&(s(e,":hover")||s(t.scrollbarX,":focus")||s(t.scrollbarY,":focus"))){var r,l=document.activeElement?document.activeElement:t.ownerDocument.activeElement;if(l){if("IFRAME"===l.tagName)l=l.contentDocument.activeElement;else for(;l.shadowRoot;)l=l.shadowRoot.activeElement;if(s(r=l,"input,[contenteditable]")||s(r,"select,[contenteditable]")||s(r,"textarea,[contenteditable]")||s(r,"button,[contenteditable]"))return}var n=0,o=0;switch(i.which){case 37:n=i.metaKey?-t.contentWidth:i.altKey?-t.containerWidth:-30;break;case 38:o=i.metaKey?t.contentHeight:i.altKey?t.containerHeight:30;break;case 39:n=i.metaKey?t.contentWidth:i.altKey?t.containerWidth:30;break;case 40:o=i.metaKey?-t.contentHeight:i.altKey?-t.containerHeight:-30;break;case 32:o=i.shiftKey?t.containerHeight:-t.containerHeight;break;case 33:o=t.containerHeight;break;case 34:o=-t.containerHeight;break;case 36:o=t.contentHeight;break;case 35:o=-t.contentHeight;break;default:return}t.settings.suppressScrollX&&0!==n||t.settings.suppressScrollY&&0!==o||(e.scrollTop-=o,e.scrollLeft+=n,L(t),function(i,r){var l=Math.floor(e.scrollTop);if(0===i){if(!t.scrollbarYActive)return!1;if(0===l&&r>0||l>=t.contentHeight-t.containerHeight&&r<0)return!t.settings.wheelPropagation}var n=e.scrollLeft;if(0===r){if(!t.scrollbarXActive)return!1;if(0===n&&i<0||n>=t.contentWidth-t.containerWidth&&i>0)return!t.settings.wheelPropagation}return!0}(n,o)&&i.preventDefault())}}))},wheel:function(t){var e=t.element;function i(i){var l=function(t){var e=t.deltaX,i=-1*t.deltaY;return void 0!==e&&void 0!==i||(e=-1*t.wheelDeltaX/6,i=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,i*=10),e!=e&&i!=i&&(e=0,i=t.wheelDelta),t.shiftKey?[-i,-e]:[e,i]}(i),n=l[0],o=l[1];if(!function(t,i,l){if(!y.isWebKit&&e.querySelector("select:focus"))return!0;if(!e.contains(t))return!1;for(var n=t;n&&n!==e;){if(n.classList.contains(d.consuming))return!0;var o=r(n);if(l&&o.overflowY.match(/(scroll|auto)/)){var s=n.scrollHeight-n.clientHeight;if(s>0&&(n.scrollTop>0&&l<0||n.scrollTop0))return!0}if(i&&o.overflowX.match(/(scroll|auto)/)){var a=n.scrollWidth-n.clientWidth;if(a>0&&(n.scrollLeft>0&&i<0||n.scrollLeft0))return!0}n=n.parentNode}return!1}(i.target,n,o)){var s=!1;t.settings.useBothWheelAxes?t.scrollbarYActive&&!t.scrollbarXActive?(o?e.scrollTop-=o*t.settings.wheelSpeed:e.scrollTop+=n*t.settings.wheelSpeed,s=!0):t.scrollbarXActive&&!t.scrollbarYActive&&(n?e.scrollLeft+=n*t.settings.wheelSpeed:e.scrollLeft-=o*t.settings.wheelSpeed,s=!0):(e.scrollTop-=o*t.settings.wheelSpeed,e.scrollLeft+=n*t.settings.wheelSpeed),L(t),(s=s||function(i,r){var l=Math.floor(e.scrollTop),n=0===e.scrollTop,o=l+e.offsetHeight===e.scrollHeight,s=0===e.scrollLeft,a=e.scrollLeft+e.offsetWidth===e.scrollWidth;return!(Math.abs(r)>Math.abs(i)?n||o:s||a)||!t.settings.wheelPropagation}(n,o))&&!i.ctrlKey&&(i.stopPropagation(),i.preventDefault())}}void 0!==window.onwheel?t.event.bind(e,"wheel",i):void 0!==window.onmousewheel&&t.event.bind(e,"mousewheel",i)},touch:function(t){if(y.supportsTouch||y.supportsIePointer){var e=t.element,i={},l=0,n={},o=null;y.supportsTouch?(t.event.bind(e,"touchstart",h),t.event.bind(e,"touchmove",u),t.event.bind(e,"touchend",f)):y.supportsIePointer&&(window.PointerEvent?(t.event.bind(e,"pointerdown",h),t.event.bind(e,"pointermove",u),t.event.bind(e,"pointerup",f)):window.MSPointerEvent&&(t.event.bind(e,"MSPointerDown",h),t.event.bind(e,"MSPointerMove",u),t.event.bind(e,"MSPointerUp",f)))}function s(i,r){e.scrollTop-=r,e.scrollLeft-=i,L(t)}function a(t){return t.targetTouches?t.targetTouches[0]:t}function c(t){return(!t.pointerType||"pen"!==t.pointerType||0!==t.buttons)&&(!(!t.targetTouches||1!==t.targetTouches.length)||!(!t.pointerType||"mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE))}function h(t){if(c(t)){var e=a(t);i.pageX=e.pageX,i.pageY=e.pageY,l=(new Date).getTime(),null!==o&&clearInterval(o)}}function u(o){if(c(o)){var h=a(o),u={pageX:h.pageX,pageY:h.pageY},f=u.pageX-i.pageX,p=u.pageY-i.pageY;if(function(t,i,l){if(!e.contains(t))return!1;for(var n=t;n&&n!==e;){if(n.classList.contains(d.consuming))return!0;var o=r(n);if(l&&o.overflowY.match(/(scroll|auto)/)){var s=n.scrollHeight-n.clientHeight;if(s>0&&(n.scrollTop>0&&l<0||n.scrollTop0))return!0}if(i&&o.overflowX.match(/(scroll|auto)/)){var a=n.scrollWidth-n.clientWidth;if(a>0&&(n.scrollLeft>0&&i<0||n.scrollLeft0))return!0}n=n.parentNode}return!1}(o.target,f,p))return;s(f,p),i=u;var b=(new Date).getTime(),g=b-l;g>0&&(n.x=f/g,n.y=p/g,l=b),function(i,r){var l=Math.floor(e.scrollTop),n=e.scrollLeft,o=Math.abs(i),s=Math.abs(r);if(s>o){if(r<0&&l===t.contentHeight-t.containerHeight||r>0&&0===l)return 0===window.scrollY&&r>0&&y.isChrome}else if(o>s&&(i<0&&n===t.contentWidth-t.containerWidth||i>0&&0===n))return!0;return!0}(f,p)&&o.preventDefault()}}function f(){t.settings.swipeEasing&&(clearInterval(o),o=setInterval((function(){t.isInitialized?clearInterval(o):n.x||n.y?Math.abs(n.x)<.01&&Math.abs(n.y)<.01?clearInterval(o):(s(30*n.x,30*n.y),n.x*=.8,n.y*=.8):clearInterval(o)}),10))}}},S=function(t,e){var i=this;if(void 0===e&&(e={}),"string"==typeof t&&(t=document.querySelector(t)),!t||!t.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var o in this.element=t,t.classList.add(h),this.settings={handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1},e)this.settings[o]=e[o];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var s,a,c=function(){return t.classList.add(f.focus)},p=function(){return t.classList.remove(f.focus)};this.isRtl="rtl"===r(t).direction,!0===this.isRtl&&t.classList.add(u),this.isNegativeScroll=(a=t.scrollLeft,t.scrollLeft=-1,s=t.scrollLeft<0,t.scrollLeft=a,s),this.negativeScrollAdjustment=this.isNegativeScroll?t.scrollWidth-t.clientWidth:0,this.event=new Y,this.ownerDocument=t.ownerDocument||document,this.scrollbarXRail=n(d.rail("x")),t.appendChild(this.scrollbarXRail),this.scrollbarX=n(d.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",c),this.event.bind(this.scrollbarX,"blur",p),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var b=r(this.scrollbarXRail);this.scrollbarXBottom=parseInt(b.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=W(b.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=W(b.borderLeftWidth)+W(b.borderRightWidth),l(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=W(b.marginLeft)+W(b.marginRight),l(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=n(d.rail("y")),t.appendChild(this.scrollbarYRail),this.scrollbarY=n(d.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",c),this.event.bind(this.scrollbarY,"blur",p),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var g=r(this.scrollbarYRail);this.scrollbarYRight=parseInt(g.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=W(g.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?function(t){var e=r(t);return W(e.width)+W(e.paddingLeft)+W(e.paddingRight)+W(e.borderLeftWidth)+W(e.borderRightWidth)}(this.scrollbarY):null,this.railBorderYWidth=W(g.borderTopWidth)+W(g.borderBottomWidth),l(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=W(g.marginTop)+W(g.marginBottom),l(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:t.scrollLeft<=0?"start":t.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:t.scrollTop<=0?"start":t.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach((function(t){return H[t](i)})),this.lastScrollTop=Math.floor(t.scrollTop),this.lastScrollLeft=t.scrollLeft,this.event.bind(this.element,"scroll",(function(t){return i.onScroll(t)})),L(this)};S.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,l(this.scrollbarXRail,{display:"block"}),l(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=W(r(this.scrollbarXRail).marginLeft)+W(r(this.scrollbarXRail).marginRight),this.railYMarginHeight=W(r(this.scrollbarYRail).marginTop)+W(r(this.scrollbarYRail).marginBottom),l(this.scrollbarXRail,{display:"none"}),l(this.scrollbarYRail,{display:"none"}),L(this),X(this,"top",0,!1,!0),X(this,"left",0,!1,!0),l(this.scrollbarXRail,{display:""}),l(this.scrollbarYRail,{display:""}))},S.prototype.onScroll=function(t){this.isAlive&&(L(this),X(this,"top",this.element.scrollTop-this.lastScrollTop),X(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},S.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),a(this.scrollbarX),a(this.scrollbarY),a(this.scrollbarXRail),a(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},S.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter((function(t){return!t.match(/^ps([-_].+|)$/)})).join(" ")},e.a=S}}]); -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/js/3.2563b7af.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[3],{312:function(e,s,t){},313:function(e,s,t){},347:function(e,s,t){"use strict";var n=t(312);t.n(n).a},348:function(e,s,t){"use strict";var n=t(313);t.n(n).a},353:function(e,s,t){"use strict";t.r(s);t(162);var n=t(346),i={name:"vue-custom-scrollbar",props:{settings:{default:null},swicher:{type:Boolean,default:!0},tagname:{type:String,default:"section"}},data:function(){return{ps:null}},methods:{scrollHandle:function(e){this.$emit(e.type,e)},update:function(){this.ps&&this.ps.update()},__init:function(){this.swicher&&(this._ps_inited?this.ps.update():(this._ps_inited=!0,this.ps=new n.a(this.$el,this.settings)))},__uninit:function(){this.ps&&(this.ps.destroy(),this.ps=null,this._ps_inited=!1)}},watch:{swicher:function(e){e&&!this._ps_inited&&this.__init(),!e&&this._ps_inited&&this.__uninit()},settings:{deep:!0,handler:function(){this.__uninit(),this.__init()}},$route:function(){this.update()}},mounted:function(){this.$isServer||this.__init()},updated:function(){this.$nextTick(this.update)},activated:function(){this.__init()},deactivated:function(){this.__uninit()},beforeDestroy:function(){this.__uninit()}},l=(t(347),t(40)),r={components:{vueCustomScrollbar:Object(l.a)(i,(function(){var e=this,s=e.$createElement;return(e._self._c||s)(e.$props.tagname,{tag:"section",staticClass:"ps-container",on:{"ps-scroll-y":e.scrollHandle,"ps-scroll-x":e.scrollHandle,"ps-scroll-up":e.scrollHandle,"ps-scroll-down":e.scrollHandle,"ps-scroll-left":e.scrollHandle,"ps-scroll-right":e.scrollHandle,"ps-y-reach-start":e.scrollHandle,"ps-y-reach-end":e.scrollHandle,"ps-x-reach-start":e.scrollHandle,"ps-x-reach-end":e.scrollHandle}},[e._t("default")],2)}),[],!1,null,null,null).exports},name:"demo-1",data:function(){return{settings:{suppressScrollY:!1,suppressScrollX:!1,wheelPropagation:!1},height:"400",width:"600"}},mounted:function(){this.IsPC()||(this.height=160,this.width=240)},methods:{scrollHanle:function(e){console.log(e)},loadMore:function(){console.log("reach end")},IsPC:function(){for(var e=navigator.userAgent,s=new Array("Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"),t=!0,n=0;n0){t=!1;break}return t}}},o=(t(348),Object(l.a)(r,(function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{attrs:{id:"demo"}},[t("vue-custom-scrollbar",{staticClass:"scroll-area",style:"width:"+e.width+"px;height:"+e.height+"px",attrs:{settings:e.settings},on:{"ps-scroll-y":e.scrollHanle,"ps-y-reach-end":e.loadMore}},[t("div",{staticClass:"demoImg"})]),e._v(" "),t("ul",[t("li",[t("label",[e._v("\n wheelPropagation\n "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.settings.wheelPropagation,expression:"settings.wheelPropagation"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.settings.wheelPropagation)?e._i(e.settings.wheelPropagation,null)>-1:e.settings.wheelPropagation},on:{change:function(s){var t=e.settings.wheelPropagation,n=s.target,i=!!n.checked;if(Array.isArray(t)){var l=e._i(t,null);n.checked?l<0&&e.$set(e.settings,"wheelPropagation",t.concat([null])):l>-1&&e.$set(e.settings,"wheelPropagation",t.slice(0,l).concat(t.slice(l+1)))}else e.$set(e.settings,"wheelPropagation",i)}}})])]),e._v(" "),t("li",[t("label",[e._v("\n suppressScrollX\n "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.settings.suppressScrollX,expression:"settings.suppressScrollX"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.settings.suppressScrollX)?e._i(e.settings.suppressScrollX,null)>-1:e.settings.suppressScrollX},on:{change:function(s){var t=e.settings.suppressScrollX,n=s.target,i=!!n.checked;if(Array.isArray(t)){var l=e._i(t,null);n.checked?l<0&&e.$set(e.settings,"suppressScrollX",t.concat([null])):l>-1&&e.$set(e.settings,"suppressScrollX",t.slice(0,l).concat(t.slice(l+1)))}else e.$set(e.settings,"suppressScrollX",i)}}})])]),e._v(" "),t("li",[t("label",[e._v("\n suppressScrollY\n "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.settings.suppressScrollY,expression:"settings.suppressScrollY"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.settings.suppressScrollY)?e._i(e.settings.suppressScrollY,null)>-1:e.settings.suppressScrollY},on:{change:function(s){var t=e.settings.suppressScrollY,n=s.target,i=!!n.checked;if(Array.isArray(t)){var l=e._i(t,null);n.checked?l<0&&e.$set(e.settings,"suppressScrollY",t.concat([null])):l>-1&&e.$set(e.settings,"suppressScrollY",t.slice(0,l).concat(t.slice(l+1)))}else e.$set(e.settings,"suppressScrollY",i)}}})])]),e._v(" "),t("li",[t("label",[e._v("\n width\n "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.width,expression:"width"}],attrs:{type:"input"},domProps:{value:e.width},on:{input:function(s){s.target.composing||(e.width=s.target.value)}}})])]),e._v(" "),t("li",[t("label",[e._v("\n height\n "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.height,expression:"height"}],attrs:{type:"input"},domProps:{value:e.height},on:{input:function(s){s.target.composing||(e.height=s.target.value)}}})])])])],1)}),[],!1,null,null,null));s.default=o.exports}}]); -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/js/4.a578c752.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[4],{314:function(t,e,n){},349:function(t,e,n){"use strict";var i=n(314);n.n(i).a},359:function(t,e,n){"use strict";n.r(e);var i={functional:!0,props:{type:{type:String,default:"tip"},text:String,vertical:{type:String,default:"top"}},render:function(t,e){var n=e.props,i=e.slots;return t("span",{class:["badge",n.type],style:{verticalAlign:n.vertical}},n.text||i().default)}},r=(n(349),n(40)),a=Object(r.a)(i,void 0,void 0,!1,null,"c922b936",null);e.default=a.exports}}]); -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/js/5.9de75006.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{315:function(t,e,c){},350:function(t,e,c){"use strict";var i=c(315);c.n(i).a},355:function(t,e,c){"use strict";c.r(e);var i={name:"CodeBlock",props:{title:{type:String,required:!0},active:{type:Boolean,default:!1}}},n=(c(350),c(40)),a=Object(n.a)(i,(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"theme-code-block",class:{"theme-code-block__active":this.active}},[this._t("default")],2)}),[],!1,null,"3b51d646",null);e.default=a.exports}}]); -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/js/6.d7cf16d8.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{316:function(e,t,o){},351:function(e,t,o){"use strict";var a=o(316);o.n(a).a},356:function(e,t,o){"use strict";o.r(t);o(24),o(91),o(64),o(93);var a={name:"CodeGroup",data:function(){return{codeTabs:[],activeCodeTabIndex:-1}},watch:{activeCodeTabIndex:function(e){this.codeTabs.forEach((function(e){e.elm.classList.remove("theme-code-block__active")})),this.codeTabs[e].elm.classList.add("theme-code-block__active")}},mounted:function(){var e=this;this.codeTabs=(this.$slots.default||[]).filter((function(e){return Boolean(e.componentOptions)})).map((function(t,o){return""===t.componentOptions.propsData.active&&(e.activeCodeTabIndex=o),{title:t.componentOptions.propsData.title,elm:t.elm}})),-1===this.activeCodeTabIndex&&this.codeTabs.length>0&&(this.activeCodeTabIndex=0)},methods:{changeCodeTab:function(e){this.activeCodeTabIndex=e}}},n=(o(351),o(40)),c=Object(n.a)(a,(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"theme-code-group"},[o("div",{staticClass:"theme-code-group__nav"},e._l(e.codeTabs,(function(t,a){return o("button",{key:t.title,staticClass:"theme-code-group__nav-tab",class:{"theme-code-group__nav-tab-active":a===e.activeCodeTabIndex},on:{click:function(t){return e.changeCodeTab(a)}}},[e._v("\n "+e._s(t.title)+"\n ")])})),0),e._v(" "),e._t("default"),e._v(" "),e.codeTabs.length<1?o("pre",{staticClass:"pre-blank"},[e._v("// Make sure to add code blocks to your code group")]):e._e()],2)}),[],!1,null,"02730c6e",null);t.default=c.exports}}]); -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/js/7.8f3a7d09.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{354:function(t,e,s){"use strict";s.r(e);var n=["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],o={methods:{getMsg:function(){return n[Math.floor(Math.random()*n.length)]}}},i=s(40),h=Object(i.a)(o,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"theme-container"},[e("div",{staticClass:"theme-default-content"},[e("h1",[this._v("404")]),this._v(" "),e("blockquote",[this._v(this._s(this.getMsg()))]),this._v(" "),e("RouterLink",{attrs:{to:"/"}},[this._v("\n Take me home.\n ")])],1)])}),[],!1,null,null,null);e.default=h.exports}}]); -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/js/8.c4095d57.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[8],{357:function(t,a,s){"use strict";s.r(a);var r=s(40),e=Object(r.a)({},(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"vue-custom-scrollbar"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#vue-custom-scrollbar"}},[t._v("#")]),t._v(" vue-custom-scrollbar")]),t._v(" "),s("p",[t._v("Vue.JS 的简约但完美的自定义滚动条组件(使用了 "),s("a",{attrs:{href:"https://github.com/utatti/perfect-scrollbar",target:"_blank",rel:"noopener noreferrer"}},[t._v("utatti/perfect-scrollbar"),s("OutboundLink")],1),t._v(",所以如果遇到某些问题,可以查看 "),s("code",[t._v("perfect-scrollbar")]),t._v(" 仓库)")]),t._v(" "),s("h2",{attrs:{id:"为什么要自定义滚动条"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#为什么要自定义滚动条"}},[t._v("#")]),t._v(" 为什么要自定义滚动条")]),t._v(" "),s("p",[t._v("众所周知,谷歌浏览器支持自定义滚动条,但是火狐或其他浏览器不支持,如果你希望你的网站更完美,就用这个组件吧~")]),t._v(" "),s("h2",{attrs:{id:"为什么要使用-vue-custom-scrollbar"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#为什么要使用-vue-custom-scrollbar"}},[t._v("#")]),t._v(" 为什么要使用 vue-custom-scrollbar?")]),t._v(" "),s("p",[s("code",[t._v("vue-custom-scrollbar")]),t._v(" 是 Vue.JS 的一个简约但完美的自定义滚动条组件")]),t._v(" "),s("ul",[s("li",[t._v("不改变设计布局")]),t._v(" "),s("li",[t._v("不需要手动操作 DOM")]),t._v(" "),s("li",[t._v("使用普通的 "),s("code",[t._v("scrollTop")]),t._v(" and "),s("code",[t._v("scrollLeft")])]),t._v(" "),s("li",[t._v("滚动条样式可完全自定义")]),t._v(" "),s("li",[t._v("布局更改后更新")])]),t._v(" "),s("h1",{attrs:{id:"demo"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#demo"}},[t._v("#")]),t._v(" Demo")]),t._v(" "),s("ClientOnly",[s("demo-1")],1),t._v(" "),s("h2",{attrs:{id:"安装"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#安装"}},[t._v("#")]),t._v(" 安装")]),t._v(" "),s("p",[t._v("安装和使用 "),s("code",[t._v("vue-custom-scrollbar")]),t._v(" 的最好的方式是使用 "),s("code",[t._v("npm")]),t._v(" 或者 "),s("code",[t._v("yarn")]),t._v(". 它被注册为 "),s("a",{attrs:{href:"https://www.npmjs.com/package/vue-custom-scrollbar",target:"_blank",rel:"noopener noreferrer"}},[t._v("vue-custom-scrollbarr"),s("OutboundLink")],1),t._v(".")]),t._v(" "),s("h4",{attrs:{id:"npm"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#npm"}},[t._v("#")]),t._v(" npm")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("$ npm install vue-custom-scrollbar\n")])])]),s("h3",{attrs:{id:"或者"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#或者"}},[t._v("#")]),t._v(" 或者")]),t._v(" "),s("h4",{attrs:{id:"yarn"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#yarn"}},[t._v("#")]),t._v(" yarn")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("$ yarn add vue-custom-scrollbar\n")])])]),s("h2",{attrs:{id:"警告"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#警告"}},[t._v("#")]),t._v(" 警告")]),t._v(" "),s("p",[s("code",[t._v("vue-custom-scrollbar")]),t._v(" 可以模拟滚动条, 但不是全部类型的. 它在某些情况下也不起作用.你可以在 "),s("a",{attrs:{href:"https://github.com/utatti/perfect-scrollbar/wiki/Caveats",target:"_blank",rel:"noopener noreferrer"}},[t._v("Caveats"),s("OutboundLink")],1),t._v(" 找到例子.\n基本上,警告中列出的项目实施起来很苛刻,将来可能无法实施。如果确实需要这些功能,请考虑使用浏览器自带的滚动条")]),t._v(" "),s("h2",{attrs:{id:"如何使用"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#如何使用"}},[t._v("#")]),t._v(" 如何使用")]),t._v(" "),s("p",[t._v("实例代码:")]),t._v(" "),s("div",{staticClass:"language-vue extra-class"},[s("pre",{pre:!0,attrs:{class:"language-vue"}},[s("code",[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("template")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("vue-custom-scrollbar")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("scroll-area"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":settings")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("settings"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("@ps-scroll-y")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("scrollHanle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("img")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("src")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("https://raw.githubusercontent.com/Binaryify/vue-custom-scrollbar/master/docs/azusa.jpg"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("height")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("720"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("width")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("1280"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("alt")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("script")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token script"}},[s("span",{pre:!0,attrs:{class:"token language-javascript"}},[t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" vueCustomScrollbar "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue-custom-scrollbar'")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"vue-custom-scrollbar/dist/vueScrollbar.css"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("export")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n components"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n vueCustomScrollbar\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n settings"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n suppressScrollY"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n suppressScrollX"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n wheelPropagation"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n methods"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("scrollHanle")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("evt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("evt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("style")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token style"}},[s("span",{pre:!0,attrs:{class:"token language-css"}},[t._v("\n"),s("span",{pre:!0,attrs:{class:"token selector"}},[t._v(".scroll-area")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("position")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" relative"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("margin")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" auto"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("width")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 600px"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v("height")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 400px"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),s("h2",{attrs:{id:"选项"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#选项"}},[t._v("#")]),t._v(" 选项")]),t._v(" "),s("h3",{attrs:{id:"swicher-boolean"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#swicher-boolean"}},[t._v("#")]),t._v(" "),s("code",[t._v("swicher {Boolean}")])]),t._v(" "),s("p",[t._v("禁用或启用组件")]),t._v(" "),s("p",[s("strong",[t._v("Default")]),t._v(": "),s("code",[t._v("true")])]),t._v(" "),s("h3",{attrs:{id:"tagname-string"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#tagname-string"}},[t._v("#")]),t._v(" "),s("code",[t._v("tagname {String}")])]),t._v(" "),s("p",[t._v("默认组件根元素为 "),s("code",[t._v("section")]),t._v(",设置该值可修改组件根元素为其他元素,如:"),s("code",[t._v("div")])]),t._v(" "),s("p",[s("strong",[t._v("Default")]),t._v(": "),s("code",[t._v("section")])]),t._v(" "),s("h3",{attrs:{id:"handlers-string"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#handlers-string"}},[t._v("#")]),t._v(" "),s("code",[t._v("handlers {String[]}")])]),t._v(" "),s("p",[t._v("滚动元素的事件列表")]),t._v(" "),s("p",[s("strong",[t._v("Default")]),t._v(": "),s("code",[t._v("['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch']")])]),t._v(" "),s("h3",{attrs:{id:"wheelspeed-number"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#wheelspeed-number"}},[t._v("#")]),t._v(" "),s("code",[t._v("wheelSpeed {Number}")])]),t._v(" "),s("p",[t._v("鼠标滚轮事件的滚动速度")]),t._v(" "),s("p",[s("strong",[t._v("Default")]),t._v(": "),s("code",[t._v("1")])]),t._v(" "),s("h3",{attrs:{id:"wheelpropagation-boolean"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#wheelpropagation-boolean"}},[t._v("#")]),t._v(" "),s("code",[t._v("wheelPropagation {Boolean}")])]),t._v(" "),s("p",[t._v("如果此选项为 true,则当滚动到达边的末尾时,mousewheel 事件将传播到父元素。")]),t._v(" "),s("p",[s("strong",[t._v("Default")]),t._v(": "),s("code",[t._v("true")])]),t._v(" "),s("h3",{attrs:{id:"swipeeasing-boolean"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#swipeeasing-boolean"}},[t._v("#")]),t._v(" "),s("code",[t._v("swipeEasing {Boolean}")])]),t._v(" "),s("p",[t._v("如果此选项为 true,则会滚动得比较平缓。")]),t._v(" "),s("p",[s("strong",[t._v("Default")]),t._v(": "),s("code",[t._v("true")])]),t._v(" "),s("h3",{attrs:{id:"minscrollbarlength-number"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#minscrollbarlength-number"}},[t._v("#")]),t._v(" "),s("code",[t._v("minScrollbarLength {Number?}")])]),t._v(" "),s("p",[t._v("设置为整数值时,滚动条的滑块部分不会小于该像素数以下。")]),t._v(" "),s("p",[s("strong",[t._v("Default")]),t._v(": "),s("code",[t._v("null")])]),t._v(" "),s("h3",{attrs:{id:"maxscrollbarlength-number"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#maxscrollbarlength-number"}},[t._v("#")]),t._v(" "),s("code",[t._v("maxScrollbarLength {Number?}")])]),t._v(" "),s("p",[t._v("设置为整数值时,滚动条的滑块部分不会超过该像素数。")]),t._v(" "),s("p",[s("strong",[t._v("Default")]),t._v(": "),s("code",[t._v("null")])]),t._v(" "),s("h3",{attrs:{id:"scrollingthreshold-number"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#scrollingthreshold-number"}},[t._v("#")]),t._v(" "),s("code",[t._v("scrollingThreshold {Number}")])]),t._v(" "),s("p",[t._v("这将设置 "),s("code",[t._v("ps--scrolling-x")]),t._v(" 和 "),s("code",[t._v("ps--scrolling-y")]),t._v("的停留时间阈值。在默认的 CSS 中,无论悬停状态如何,它们都会显示滚动条。单位是毫秒。")]),t._v(" "),s("p",[s("strong",[t._v("Default")]),t._v(": "),s("code",[t._v("1000")])]),t._v(" "),s("h3",{attrs:{id:"usebothwheelaxes-boolean"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#usebothwheelaxes-boolean"}},[t._v("#")]),t._v(" "),s("code",[t._v("useBothWheelAxes {Boolean}")])]),t._v(" "),s("p",[t._v("设置为 true 时,且只有一个(垂直或水平)滚动条是可视的,则垂直和水平滚动都会影响滚动条。")]),t._v(" "),s("p",[s("strong",[t._v("Default")]),t._v(": "),s("code",[t._v("false")])]),t._v(" "),s("h3",{attrs:{id:"suppressscrollx-boolean"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#suppressscrollx-boolean"}},[t._v("#")]),t._v(" "),s("code",[t._v("suppressScrollX {Boolean}")])]),t._v(" "),s("p",[t._v("设置为 true 时,无论内容宽度如何,X 轴上的滚动条都将不可用。")]),t._v(" "),s("p",[s("strong",[t._v("Default")]),t._v(": "),s("code",[t._v("false")])]),t._v(" "),s("h3",{attrs:{id:"suppressscrolly-boolean"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#suppressscrolly-boolean"}},[t._v("#")]),t._v(" "),s("code",[t._v("suppressScrollY {Boolean}")])]),t._v(" "),s("p",[t._v("设置为 true 时,无论内容高度如何,Y 轴上的滚动条都将不可用。")]),t._v(" "),s("p",[s("strong",[t._v("Default")]),t._v(": "),s("code",[t._v("false")])]),t._v(" "),s("h3",{attrs:{id:"scrollxmarginoffset-number"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#scrollxmarginoffset-number"}},[t._v("#")]),t._v(" "),s("code",[t._v("scrollXMarginOffset {Number}")])]),t._v(" "),s("p",[t._v("在不启用 X 轴滚动条的情况下,内容宽度可以超过容器宽度的像素数。")]),t._v(" "),s("p",[s("strong",[t._v("Default")]),t._v(": "),s("code",[t._v("0")])]),t._v(" "),s("h3",{attrs:{id:"scrollymarginoffset-number"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#scrollymarginoffset-number"}},[t._v("#")]),t._v(" "),s("code",[t._v("scrollYMarginOffset {Number}")])]),t._v(" "),s("p",[t._v("在不启用 Y 轴滚动条的情况下,内容高度可以超过容器高度的像素数。")]),t._v(" "),s("p",[s("strong",[t._v("Default")]),t._v(": "),s("code",[t._v("0")])]),t._v(" "),s("h2",{attrs:{id:"事件"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#事件"}},[t._v("#")]),t._v(" 事件")]),t._v(" "),s("p",[t._v("vue-custom-scrollbar 触发的自定义事件.")]),t._v(" "),s("h3",{attrs:{id:"ps-scroll-y"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ps-scroll-y"}},[t._v("#")]),t._v(" "),s("code",[t._v("ps-scroll-y")])]),t._v(" "),s("p",[t._v("当 y 轴向任一方向滚动时,此事件将触发。")]),t._v(" "),s("h3",{attrs:{id:"ps-scroll-x"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ps-scroll-x"}},[t._v("#")]),t._v(" "),s("code",[t._v("ps-scroll-x")])]),t._v(" "),s("p",[t._v("当 x 轴向任一方向滚动时,此事件将触发。")]),t._v(" "),s("h3",{attrs:{id:"ps-scroll-up"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ps-scroll-up"}},[t._v("#")]),t._v(" "),s("code",[t._v("ps-scroll-up")])]),t._v(" "),s("p",[t._v("向上滚动时会触发此事件。")]),t._v(" "),s("h3",{attrs:{id:"ps-scroll-down"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ps-scroll-down"}},[t._v("#")]),t._v(" "),s("code",[t._v("ps-scroll-down")])]),t._v(" "),s("p",[t._v("向下滚动时会触发此事件。")]),t._v(" "),s("h3",{attrs:{id:"ps-scroll-left"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ps-scroll-left"}},[t._v("#")]),t._v(" "),s("code",[t._v("ps-scroll-left")])]),t._v(" "),s("p",[t._v("滚动到左侧时会触发此事件。")]),t._v(" "),s("h3",{attrs:{id:"ps-scroll-right"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ps-scroll-right"}},[t._v("#")]),t._v(" "),s("code",[t._v("ps-scroll-right")])]),t._v(" "),s("p",[t._v("滚动到右侧时会触发此事件。")]),t._v(" "),s("h3",{attrs:{id:"ps-y-reach-start"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ps-y-reach-start"}},[t._v("#")]),t._v(" "),s("code",[t._v("ps-y-reach-start")])]),t._v(" "),s("p",[t._v("滚动到达 y 轴的起点时会触发此事件。")]),t._v(" "),s("h3",{attrs:{id:"ps-y-reach-end"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ps-y-reach-end"}},[t._v("#")]),t._v(" "),s("code",[t._v("ps-y-reach-end")])]),t._v(" "),s("p",[t._v("当滚动到达 y 轴的末尾时,此事件将触发(对于无限滚动非常有用)。")]),t._v(" "),s("h3",{attrs:{id:"ps-x-reach-start"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ps-x-reach-start"}},[t._v("#")]),t._v(" "),s("code",[t._v("ps-x-reach-start")])]),t._v(" "),s("p",[t._v("滚动到达 x 轴的起点时会触发此事件。")]),t._v(" "),s("h3",{attrs:{id:"ps-x-reach-end"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ps-x-reach-end"}},[t._v("#")]),t._v(" "),s("code",[t._v("ps-x-reach-end")])]),t._v(" "),s("p",[t._v("滚动到达 x 轴末端时会触发此事件。")]),t._v(" "),s("h2",{attrs:{id:"自定义样式"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#自定义样式"}},[t._v("#")]),t._v(" 自定义样式")]),t._v(" "),s("p",[t._v("请参考 "),s("a",{attrs:{href:"https://github.com/utatti/perfect-scrollbar/blob/master/css/perfect-scrollbar.css",target:"_blank",rel:"noopener noreferrer"}},[t._v("perfect-scrollbar"),s("OutboundLink")],1),t._v(",然后在你的项目覆盖对应 class 的样式")]),t._v(" "),s("h2",{attrs:{id:"帮助台"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#帮助台"}},[t._v("#")]),t._v(" 帮助台")]),t._v(" "),s("p",[t._v("如果您有任何想法改进此项目或使用此项目的任何问题,请随时提交 "),s("a",{attrs:{href:"https://github.com/binaryify/vue-custom-scrollbar/issues",target:"_blank",rel:"noopener noreferrer"}},[t._v("issue"),s("OutboundLink")],1)]),t._v(" "),s("p",[t._v("对于常见的问题, 这里有一个 "),s("a",{attrs:{href:"https://github.com/utatti/perfect-scrollbar/wiki/FAQ",target:"_blank",rel:"noopener noreferrer"}},[t._v("FAQ"),s("OutboundLink")],1),t._v(" 维基页面. 请在提交 issues 前查看该页面。")]),t._v(" "),s("p",[t._v("请理解,解决问题可能需要一段时间。上传 PR 将是解决问题的最快方法。")]),t._v(" "),s("h2",{attrs:{id:"ie-支持"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ie-支持"}},[t._v("#")]),t._v(" IE 支持")]),t._v(" "),s("p",[t._v("该插件支持现代浏览器,包括 Edge 和 IE11,但在 IE11 中可能存在一些问题,主要是因为 IE 渲染错误涉及滚动属性上的同步更新。在\n"),s("a",{attrs:{href:"https://github.com/utatti/perfect-scrollbar/wiki/Caveats",target:"_blank",rel:"noopener noreferrer"}},[t._v("Caveats"),s("OutboundLink")],1),t._v(" 也提到了这个问题 。")]),t._v(" "),s("p",[t._v("不支持 IE <11,并且不接受用于修复 IE <= 10 中的问题的补丁。如果想支持旧的 IE,请 fork 此项目并在本地进行修改。")]),t._v(" "),s("h2",{attrs:{id:"更多"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#更多"}},[t._v("#")]),t._v(" 更多")]),t._v(" "),s("p",[t._v("请参考 "),s("a",{attrs:{href:"https://github.com/utatti/perfect-scrollbar",target:"_blank",rel:"noopener noreferrer"}},[t._v("perfect-scrollbar"),s("OutboundLink")],1)]),t._v(" "),s("h2",{attrs:{id:"license"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#license"}},[t._v("#")]),t._v(" License")]),t._v(" "),s("p",[s("a",{attrs:{href:"https://github.com/Binaryify/vue-custom-scrollbar/blob/master/LICENSE",target:"_blank",rel:"noopener noreferrer"}},[t._v("MIT"),s("OutboundLink")],1)])],1)}),[],!1,null,null,null);a.default=e.exports}}]); -------------------------------------------------------------------------------- /docs/.vuepress/dist/assets/js/9.56671dfb.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[9],{358:function(t,s,a){"use strict";a.r(s);var e=a(40),r=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"vue-custom-scrollbar"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#vue-custom-scrollbar"}},[t._v("#")]),t._v(" vue-custom-scrollbar")]),t._v(" "),a("p",[t._v("Minimalistic but perfect custom scrollbar component for Vue.JS(using "),a("a",{attrs:{href:"https://github.com/utatti/perfect-scrollbar",target:"_blank",rel:"noopener noreferrer"}},[t._v("utatti/perfect-scrollbar"),a("OutboundLink")],1),t._v(", so if you have any question, you also can check the "),a("code",[t._v("perfect-scrollbar")]),t._v(" repo)")]),t._v(" "),a("h2",{attrs:{id:"why-custom-scrollbar"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#why-custom-scrollbar"}},[t._v("#")]),t._v(" Why custom scrollbar")]),t._v(" "),a("p",[t._v("As you know, Chrome support custom scrollbar, but Firefox or other browsers don't support it, if you want your website perfect, please use this component~")]),t._v(" "),a("h2",{attrs:{id:"why-use-vue-custom-scrollbar"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#why-use-vue-custom-scrollbar"}},[t._v("#")]),t._v(" Why use vue-custom-scrollbar?")]),t._v(" "),a("p",[a("code",[t._v("vue-custom-scrollbar")]),t._v(" is minimalistic but perfect scrollbar component for Vue.JS.")]),t._v(" "),a("ul",[a("li",[t._v("No change on design layout")]),t._v(" "),a("li",[t._v("Don't need manipulate DOM manually")]),t._v(" "),a("li",[t._v("Use plain "),a("code",[t._v("scrollTop")]),t._v(" and "),a("code",[t._v("scrollLeft")])]),t._v(" "),a("li",[t._v("Scrollbar style is fully customizable")]),t._v(" "),a("li",[t._v("Efficient update on layout change")])]),t._v(" "),a("h1",{attrs:{id:"demo"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#demo"}},[t._v("#")]),t._v(" Demo")]),t._v(" "),a("ClientOnly",[a("demo-1")],1),t._v(" "),a("h2",{attrs:{id:"install"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#install"}},[t._v("#")]),t._v(" Install")]),t._v(" "),a("p",[t._v("The best way to install and use "),a("code",[t._v("vue-custom-scrollbar")]),t._v(" is with "),a("code",[t._v("npm")]),t._v(" or "),a("code",[t._v("yarn")]),t._v(". It's registered\nas "),a("a",{attrs:{href:"https://www.npmjs.com/package/vue-custom-scrollbar",target:"_blank",rel:"noopener noreferrer"}},[t._v("vue-custom-scrollbarr"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h4",{attrs:{id:"npm"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#npm"}},[t._v("#")]),t._v(" npm")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("$ npm install vue-custom-scrollbar\n")])])]),a("h3",{attrs:{id:"or"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#or"}},[t._v("#")]),t._v(" Or")]),t._v(" "),a("h4",{attrs:{id:"yarn"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#yarn"}},[t._v("#")]),t._v(" yarn")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("$ yarn add vue-custom-scrollbar\n")])])]),a("h2",{attrs:{id:"caveats"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#caveats"}},[t._v("#")]),t._v(" Caveats")]),t._v(" "),a("p",[a("code",[t._v("vue-custom-scrollbar")]),t._v(" emulates some scrolls, but not all of the kinds. It also "),a("em",[t._v("does not")]),t._v(" work\nin some situations. You can find these cases in "),a("a",{attrs:{href:"https://github.com/utatti/perfect-scrollbar/wiki/Caveats",target:"_blank",rel:"noopener noreferrer"}},[t._v("Caveats"),a("OutboundLink")],1),t._v(".\nBasically, items listed in the caveats are hacky to implement and may not be\nimplemented in the future. If the features are really needed, please consider\nusing browser-native scroll.")]),t._v(" "),a("h2",{attrs:{id:"how-to-use"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#how-to-use"}},[t._v("#")]),t._v(" How to use")]),t._v(" "),a("p",[t._v("Example code:")]),t._v(" "),a("div",{staticClass:"language-vue extra-class"},[a("pre",{pre:!0,attrs:{class:"language-vue"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("template")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("vue-custom-scrollbar")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("scroll-area"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v(":settings")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("settings"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("@ps-scroll-y")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("scrollHanle"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("img")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("src")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("https://raw.githubusercontent.com/Binaryify/vue-custom-scrollbar/master/docs/azusa.jpg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("height")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("720"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("width")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("1280"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("alt")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("script")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token script"}},[a("span",{pre:!0,attrs:{class:"token language-javascript"}},[t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" vueCustomScrollbar "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'vue-custom-scrollbar'")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"vue-custom-scrollbar/dist/vueScrollbar.css"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("export")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n components"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n vueCustomScrollbar\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("data")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n settings"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n suppressScrollY"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n suppressScrollX"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n wheelPropagation"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n methods"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("scrollHanle")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("evt")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("evt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("style")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token style"}},[a("span",{pre:!0,attrs:{class:"token language-css"}},[t._v("\n"),a("span",{pre:!0,attrs:{class:"token selector"}},[t._v(".scroll-area")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("position")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" relative"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("margin")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" auto"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("width")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 600px"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("height")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 400px"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),a("h2",{attrs:{id:"options"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#options"}},[t._v("#")]),t._v(" Options")]),t._v(" "),a("h3",{attrs:{id:"swicher-boolean"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#swicher-boolean"}},[t._v("#")]),t._v(" "),a("code",[t._v("swicher {Boolean}")])]),t._v(" "),a("p",[t._v("Enable or disable this component")]),t._v(" "),a("p",[a("strong",[t._v("Default")]),t._v(": "),a("code",[t._v("true")])]),t._v(" "),a("h3",{attrs:{id:"tagname-string"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#tagname-string"}},[t._v("#")]),t._v(" "),a("code",[t._v("tagname {String}")])]),t._v(" "),a("p",[t._v("Component default root element is "),a("code",[t._v("section")]),t._v(", setting other value can change it, for example : "),a("code",[t._v("div")])]),t._v(" "),a("p",[a("strong",[t._v("Default")]),t._v(": "),a("code",[t._v("section")])]),t._v(" "),a("h3",{attrs:{id:"handlers-string"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#handlers-string"}},[t._v("#")]),t._v(" "),a("code",[t._v("handlers {String[]}")])]),t._v(" "),a("p",[t._v("It is a list of handlers to scroll the element.")]),t._v(" "),a("p",[a("strong",[t._v("Default")]),t._v(": "),a("code",[t._v("['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch']")])]),t._v(" "),a("h3",{attrs:{id:"wheelspeed-number"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#wheelspeed-number"}},[t._v("#")]),t._v(" "),a("code",[t._v("wheelSpeed {Number}")])]),t._v(" "),a("p",[t._v("The scroll speed applied to mousewheel event.")]),t._v(" "),a("p",[a("strong",[t._v("Default")]),t._v(": "),a("code",[t._v("1")])]),t._v(" "),a("h3",{attrs:{id:"wheelpropagation-boolean"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#wheelpropagation-boolean"}},[t._v("#")]),t._v(" "),a("code",[t._v("wheelPropagation {Boolean}")])]),t._v(" "),a("p",[t._v("If this option is true, when the scroll reaches the end of the side, mousewheel\nevent will be propagated to parent element.")]),t._v(" "),a("p",[a("strong",[t._v("Default")]),t._v(": "),a("code",[t._v("true")])]),t._v(" "),a("h3",{attrs:{id:"swipeeasing-boolean"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#swipeeasing-boolean"}},[t._v("#")]),t._v(" "),a("code",[t._v("swipeEasing {Boolean}")])]),t._v(" "),a("p",[t._v("If this option is true, swipe scrolling will be eased.")]),t._v(" "),a("p",[a("strong",[t._v("Default")]),t._v(": "),a("code",[t._v("true")])]),t._v(" "),a("h3",{attrs:{id:"minscrollbarlength-number"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#minscrollbarlength-number"}},[t._v("#")]),t._v(" "),a("code",[t._v("minScrollbarLength {Number?}")])]),t._v(" "),a("p",[t._v("When set to an integer value, the thumb part of the scrollbar will not shrink\nbelow that number of pixels.")]),t._v(" "),a("p",[a("strong",[t._v("Default")]),t._v(": "),a("code",[t._v("null")])]),t._v(" "),a("h3",{attrs:{id:"maxscrollbarlength-number"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#maxscrollbarlength-number"}},[t._v("#")]),t._v(" "),a("code",[t._v("maxScrollbarLength {Number?}")])]),t._v(" "),a("p",[t._v("When set to an integer value, the thumb part of the scrollbar will not expand\nover that number of pixels.")]),t._v(" "),a("p",[a("strong",[t._v("Default")]),t._v(": "),a("code",[t._v("null")])]),t._v(" "),a("h3",{attrs:{id:"scrollingthreshold-number"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#scrollingthreshold-number"}},[t._v("#")]),t._v(" "),a("code",[t._v("scrollingThreshold {Number}")])]),t._v(" "),a("p",[t._v("This sets threashold for "),a("code",[t._v("ps--scrolling-x")]),t._v(" and "),a("code",[t._v("ps--scrolling-y")]),t._v(" classes to\nremain. In the default CSS, they make scrollbars shown regardless of hover\nstate. The unit is millisecond.")]),t._v(" "),a("p",[a("strong",[t._v("Default")]),t._v(": "),a("code",[t._v("1000")])]),t._v(" "),a("h3",{attrs:{id:"usebothwheelaxes-boolean"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#usebothwheelaxes-boolean"}},[t._v("#")]),t._v(" "),a("code",[t._v("useBothWheelAxes {Boolean}")])]),t._v(" "),a("p",[t._v("When set to true, and only one (vertical or horizontal) scrollbar is visible\nthen both vertical and horizontal scrolling will affect the scrollbar.")]),t._v(" "),a("p",[a("strong",[t._v("Default")]),t._v(": "),a("code",[t._v("false")])]),t._v(" "),a("h3",{attrs:{id:"suppressscrollx-boolean"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#suppressscrollx-boolean"}},[t._v("#")]),t._v(" "),a("code",[t._v("suppressScrollX {Boolean}")])]),t._v(" "),a("p",[t._v("When set to true, the scroll bar in X axis will not be available, regardless of\nthe content width.")]),t._v(" "),a("p",[a("strong",[t._v("Default")]),t._v(": "),a("code",[t._v("false")])]),t._v(" "),a("h3",{attrs:{id:"suppressscrolly-boolean"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#suppressscrolly-boolean"}},[t._v("#")]),t._v(" "),a("code",[t._v("suppressScrollY {Boolean}")])]),t._v(" "),a("p",[t._v("When set to true, the scroll bar in Y axis will not be available, regardless of\nthe content height.")]),t._v(" "),a("p",[a("strong",[t._v("Default")]),t._v(": "),a("code",[t._v("false")])]),t._v(" "),a("h3",{attrs:{id:"scrollxmarginoffset-number"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#scrollxmarginoffset-number"}},[t._v("#")]),t._v(" "),a("code",[t._v("scrollXMarginOffset {Number}")])]),t._v(" "),a("p",[t._v("The number of pixels the content width can surpass the container width without\nenabling the X axis scroll bar.")]),t._v(" "),a("p",[a("strong",[t._v("Default")]),t._v(": "),a("code",[t._v("0")])]),t._v(" "),a("h3",{attrs:{id:"scrollymarginoffset-number"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#scrollymarginoffset-number"}},[t._v("#")]),t._v(" "),a("code",[t._v("scrollYMarginOffset {Number}")])]),t._v(" "),a("p",[t._v("The number of pixels the content height can surpass the container height without\nenabling the Y axis scroll bar.")]),t._v(" "),a("p",[a("strong",[t._v("Default")]),t._v(": "),a("code",[t._v("0")])]),t._v(" "),a("h2",{attrs:{id:"events"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#events"}},[t._v("#")]),t._v(" Events")]),t._v(" "),a("p",[t._v("vue-custom-scrollbar dispatches custom events.")]),t._v(" "),a("h3",{attrs:{id:"ps-scroll-y"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ps-scroll-y"}},[t._v("#")]),t._v(" "),a("code",[t._v("ps-scroll-y")])]),t._v(" "),a("p",[t._v("This event fires when the y-axis is scrolled in either direction.")]),t._v(" "),a("h3",{attrs:{id:"ps-scroll-x"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ps-scroll-x"}},[t._v("#")]),t._v(" "),a("code",[t._v("ps-scroll-x")])]),t._v(" "),a("p",[t._v("This event fires when the x-axis is scrolled in either direction.")]),t._v(" "),a("h3",{attrs:{id:"ps-scroll-up"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ps-scroll-up"}},[t._v("#")]),t._v(" "),a("code",[t._v("ps-scroll-up")])]),t._v(" "),a("p",[t._v("This event fires when scrolling upwards.")]),t._v(" "),a("h3",{attrs:{id:"ps-scroll-down"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ps-scroll-down"}},[t._v("#")]),t._v(" "),a("code",[t._v("ps-scroll-down")])]),t._v(" "),a("p",[t._v("This event fires when scrolling downwards.")]),t._v(" "),a("h3",{attrs:{id:"ps-scroll-left"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ps-scroll-left"}},[t._v("#")]),t._v(" "),a("code",[t._v("ps-scroll-left")])]),t._v(" "),a("p",[t._v("This event fires when scrolling to the left.")]),t._v(" "),a("h3",{attrs:{id:"ps-scroll-right"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ps-scroll-right"}},[t._v("#")]),t._v(" "),a("code",[t._v("ps-scroll-right")])]),t._v(" "),a("p",[t._v("This event fires when scrolling to the right.")]),t._v(" "),a("h3",{attrs:{id:"ps-y-reach-start"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ps-y-reach-start"}},[t._v("#")]),t._v(" "),a("code",[t._v("ps-y-reach-start")])]),t._v(" "),a("p",[t._v("This event fires when scrolling reaches the start of the y-axis.")]),t._v(" "),a("h3",{attrs:{id:"ps-y-reach-end"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ps-y-reach-end"}},[t._v("#")]),t._v(" "),a("code",[t._v("ps-y-reach-end")])]),t._v(" "),a("p",[t._v("This event fires when scrolling reaches the end of the y-axis (useful for\ninfinite scroll).")]),t._v(" "),a("h3",{attrs:{id:"ps-x-reach-start"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ps-x-reach-start"}},[t._v("#")]),t._v(" "),a("code",[t._v("ps-x-reach-start")])]),t._v(" "),a("p",[t._v("This event fires when scrolling reaches the start of the x-axis.")]),t._v(" "),a("h3",{attrs:{id:"ps-x-reach-end"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ps-x-reach-end"}},[t._v("#")]),t._v(" "),a("code",[t._v("ps-x-reach-end")])]),t._v(" "),a("p",[t._v("This event fires when scrolling reaches the end of the x-axis.")]),t._v(" "),a("h2",{attrs:{id:"custom-style"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#custom-style"}},[t._v("#")]),t._v(" Custom style")]),t._v(" "),a("p",[t._v("Please refer to "),a("a",{attrs:{href:"https://github.com/utatti/perfect-scrollbar/blob/master/css/perfect-scrollbar.css",target:"_blank",rel:"noopener noreferrer"}},[t._v("perfect-scrollbar"),a("OutboundLink")],1),t._v(", then override the corresponding class style in your project")]),t._v(" "),a("h2",{attrs:{id:"helpdesk"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#helpdesk"}},[t._v("#")]),t._v(" Helpdesk")]),t._v(" "),a("p",[t._v("If you have any idea to improve this project or any problem using this, please\nfeel free to upload an "),a("a",{attrs:{href:"https://github.com/utatti/perfect-scrollbar/issues",target:"_blank",rel:"noopener noreferrer"}},[t._v("issue"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("p",[t._v("For common problems, there is a "),a("a",{attrs:{href:"https://github.com/utatti/perfect-scrollbar/wiki/FAQ",target:"_blank",rel:"noopener noreferrer"}},[t._v("FAQ"),a("OutboundLink")],1),t._v(" wiki\npage. Please check the page before uploading an issue.")]),t._v(" "),a("p",[t._v("Uploading a PR would be the fastest way to fix an issue.")]),t._v(" "),a("h2",{attrs:{id:"ie-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ie-support"}},[t._v("#")]),t._v(" IE Support")]),t._v(" "),a("p",[t._v("The plugin support modern browsers including Edge and IE11,\nbut may have some issues in IE11 mainly because of IE rendering bug concerning\nsync update on scroll properties. The problem is mentioned in\n"),a("a",{attrs:{href:"https://github.com/utatti/perfect-scrollbar/wiki/Caveats",target:"_blank",rel:"noopener noreferrer"}},[t._v("Caveats"),a("OutboundLink")],1),t._v(" too.")]),t._v(" "),a("p",[t._v("IE<11 is not supported, and patches to fix problems in IE<=10 will not be\naccepted. When old IEs should be supported, please fork the project and make\nmodification locally.")]),t._v(" "),a("h2",{attrs:{id:"more"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#more"}},[t._v("#")]),t._v(" More")]),t._v(" "),a("p",[t._v("Please refer to "),a("a",{attrs:{href:"https://github.com/utatti/perfect-scrollbar",target:"_blank",rel:"noopener noreferrer"}},[t._v("perfect-scrollbar"),a("OutboundLink")],1)]),t._v(" "),a("h2",{attrs:{id:"license"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#license"}},[t._v("#")]),t._v(" License")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/Binaryify/vue-custom-scrollbar/blob/master/LICENSE",target:"_blank",rel:"noopener noreferrer"}},[t._v("MIT"),a("OutboundLink")],1)])],1)}),[],!1,null,null,null);s.default=r.exports}}]); -------------------------------------------------------------------------------- /docs/.vuepress/dist/en/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | vue-custom-scrollbar 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |

# vue-custom-scrollbar

Minimalistic but perfect custom scrollbar component for Vue.JS(using utatti/perfect-scrollbar(opens new window) , so if you have any question, you also can check the perfect-scrollbar repo)

# Why custom scrollbar

As you know, Chrome support custom scrollbar, but Firefox or other browsers don't support it, if you want your website perfect, please use this component~

# Why use vue-custom-scrollbar?

vue-custom-scrollbar is minimalistic but perfect scrollbar component for Vue.JS.

  • No change on design layout
  • Don't need manipulate DOM manually
  • Use plain scrollTop and scrollLeft
  • Scrollbar style is fully customizable
  • Efficient update on layout change

# Demo

# Install

The best way to install and use vue-custom-scrollbar is with npm or yarn. It's registered 27 | as vue-custom-scrollbarr(opens new window) .

# npm

$ npm install vue-custom-scrollbar
28 | 

# Or

# yarn

$ yarn add vue-custom-scrollbar
29 | 

# Caveats

vue-custom-scrollbar emulates some scrolls, but not all of the kinds. It also does not work 30 | in some situations. You can find these cases in Caveats(opens new window) . 31 | Basically, items listed in the caveats are hacky to implement and may not be 32 | implemented in the future. If the features are really needed, please consider 33 | using browser-native scroll.

# How to use

Example code:

<template>
34 |  <div>
35 |  <vue-custom-scrollbar class="scroll-area"  :settings="settings" @ps-scroll-y="scrollHanle">
36 |     <img src="https://raw.githubusercontent.com/Binaryify/vue-custom-scrollbar/master/docs/azusa.jpg" height="720" width="1280" alt="">
37 |   </vue-custom-scrollbar>
38 |  </div>
39 | </template>
40 | <script>
41 | import vueCustomScrollbar from 'vue-custom-scrollbar'
42 | import "vue-custom-scrollbar/dist/vueScrollbar.css"
43 | export default {
44 |   components: {
45 |     vueCustomScrollbar
46 |   },
47 |   data() {
48 |     return {
49 |       settings: {
50 |         suppressScrollY: false,
51 |         suppressScrollX: false,
52 |         wheelPropagation: false
53 |       }
54 |     }
55 |   },
56 |   methods: {
57 |     scrollHanle(evt) {
58 |       console.log(evt)
59 |     }
60 |   }
61 | }
62 | </script>
63 | <style >
64 | .scroll-area {
65 |   position: relative;
66 |   margin: auto;
67 |   width: 600px;
68 |   height: 400px;
69 | }
70 | </style>
71 | 

# Options

# swicher {Boolean}

Enable or disable this component

Default: true

# tagname {String}

Component default root element is section, setting other value can change it, for example : div

Default: section

# handlers {String[]}

It is a list of handlers to scroll the element.

Default: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch']

# wheelSpeed {Number}

The scroll speed applied to mousewheel event.

Default: 1

# wheelPropagation {Boolean}

If this option is true, when the scroll reaches the end of the side, mousewheel 72 | event will be propagated to parent element.

Default: true

# swipeEasing {Boolean}

If this option is true, swipe scrolling will be eased.

Default: true

# minScrollbarLength {Number?}

When set to an integer value, the thumb part of the scrollbar will not shrink 73 | below that number of pixels.

Default: null

# maxScrollbarLength {Number?}

When set to an integer value, the thumb part of the scrollbar will not expand 74 | over that number of pixels.

Default: null

# scrollingThreshold {Number}

This sets threashold for ps--scrolling-x and ps--scrolling-y classes to 75 | remain. In the default CSS, they make scrollbars shown regardless of hover 76 | state. The unit is millisecond.

Default: 1000

# useBothWheelAxes {Boolean}

When set to true, and only one (vertical or horizontal) scrollbar is visible 77 | then both vertical and horizontal scrolling will affect the scrollbar.

Default: false

# suppressScrollX {Boolean}

When set to true, the scroll bar in X axis will not be available, regardless of 78 | the content width.

Default: false

# suppressScrollY {Boolean}

When set to true, the scroll bar in Y axis will not be available, regardless of 79 | the content height.

Default: false

# scrollXMarginOffset {Number}

The number of pixels the content width can surpass the container width without 80 | enabling the X axis scroll bar.

Default: 0

# scrollYMarginOffset {Number}

The number of pixels the content height can surpass the container height without 81 | enabling the Y axis scroll bar.

Default: 0

# Events

vue-custom-scrollbar dispatches custom events.

# ps-scroll-y

This event fires when the y-axis is scrolled in either direction.

# ps-scroll-x

This event fires when the x-axis is scrolled in either direction.

# ps-scroll-up

This event fires when scrolling upwards.

# ps-scroll-down

This event fires when scrolling downwards.

# ps-scroll-left

This event fires when scrolling to the left.

# ps-scroll-right

This event fires when scrolling to the right.

# ps-y-reach-start

This event fires when scrolling reaches the start of the y-axis.

# ps-y-reach-end

This event fires when scrolling reaches the end of the y-axis (useful for 82 | infinite scroll).

# ps-x-reach-start

This event fires when scrolling reaches the start of the x-axis.

# ps-x-reach-end

This event fires when scrolling reaches the end of the x-axis.

# Custom style

Please refer to perfect-scrollbar(opens new window) , then override the corresponding class style in your project

# Helpdesk

If you have any idea to improve this project or any problem using this, please 83 | feel free to upload an issue(opens new window) .

For common problems, there is a FAQ(opens new window) wiki 84 | page. Please check the page before uploading an issue.

Uploading a PR would be the fastest way to fix an issue.

# IE Support

The plugin support modern browsers including Edge and IE11, 85 | but may have some issues in IE11 mainly because of IE rendering bug concerning 86 | sync update on scroll properties. The problem is mentioned in 87 | Caveats(opens new window) too.

IE<11 is not supported, and patches to fix problems in IE<=10 will not be 88 | accepted. When old IEs should be supported, please fork the project and make 89 | modification locally.

# More

Please refer to perfect-scrollbar(opens new window)

# License

MIT(opens new window)

90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /docs/.vuepress/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | vue-custom-scrollbar 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |

# vue-custom-scrollbar

Vue.JS 的简约但完美的自定义滚动条组件(使用了 utatti/perfect-scrollbar(opens new window) ,所以如果遇到某些问题,可以查看 perfect-scrollbar 仓库)

# 为什么要自定义滚动条

众所周知,谷歌浏览器支持自定义滚动条,但是火狐或其他浏览器不支持,如果你希望你的网站更完美,就用这个组件吧~

# 为什么要使用 vue-custom-scrollbar?

vue-custom-scrollbar 是 Vue.JS 的一个简约但完美的自定义滚动条组件

  • 不改变设计布局
  • 不需要手动操作 DOM
  • 使用普通的 scrollTop and scrollLeft
  • 滚动条样式可完全自定义
  • 布局更改后更新

# Demo

# 安装

安装和使用 vue-custom-scrollbar 的最好的方式是使用 npm 或者 yarn. 它被注册为 vue-custom-scrollbarr(opens new window) .

# npm

$ npm install vue-custom-scrollbar
27 | 

# 或者

# yarn

$ yarn add vue-custom-scrollbar
28 | 

# 警告

vue-custom-scrollbar 可以模拟滚动条, 但不是全部类型的. 它在某些情况下也不起作用.你可以在 Caveats(opens new window) 找到例子. 29 | 基本上,警告中列出的项目实施起来很苛刻,将来可能无法实施。如果确实需要这些功能,请考虑使用浏览器自带的滚动条

# 如何使用

实例代码:

<template>
30 |  <div>
31 |  <vue-custom-scrollbar class="scroll-area"  :settings="settings" @ps-scroll-y="scrollHanle">
32 |     <img src="https://raw.githubusercontent.com/Binaryify/vue-custom-scrollbar/master/docs/azusa.jpg" height="720" width="1280" alt="">
33 |   </vue-custom-scrollbar>
34 |  </div>
35 | </template>
36 | <script>
37 | import vueCustomScrollbar from 'vue-custom-scrollbar'
38 | import "vue-custom-scrollbar/dist/vueScrollbar.css"
39 | export default {
40 |   components: {
41 |     vueCustomScrollbar
42 |   },
43 |   data() {
44 |     return {
45 |       settings: {
46 |         suppressScrollY: false,
47 |         suppressScrollX: false,
48 |         wheelPropagation: false
49 |       }
50 |     }
51 |   },
52 |   methods: {
53 |     scrollHanle(evt) {
54 |       console.log(evt)
55 |     }
56 |   }
57 | }
58 | </script>
59 | <style >
60 | .scroll-area {
61 |   position: relative;
62 |   margin: auto;
63 |   width: 600px;
64 |   height: 400px;
65 | }
66 | </style>
67 | 

# 选项

# swicher {Boolean}

禁用或启用组件

Default: true

# tagname {String}

默认组件根元素为 section,设置该值可修改组件根元素为其他元素,如:div

Default: section

# handlers {String[]}

滚动元素的事件列表

Default: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch']

# wheelSpeed {Number}

鼠标滚轮事件的滚动速度

Default: 1

# wheelPropagation {Boolean}

如果此选项为 true,则当滚动到达边的末尾时,mousewheel 事件将传播到父元素。

Default: true

# swipeEasing {Boolean}

如果此选项为 true,则会滚动得比较平缓。

Default: true

# minScrollbarLength {Number?}

设置为整数值时,滚动条的滑块部分不会小于该像素数以下。

Default: null

# maxScrollbarLength {Number?}

设置为整数值时,滚动条的滑块部分不会超过该像素数。

Default: null

# scrollingThreshold {Number}

这将设置 ps--scrolling-xps--scrolling-y的停留时间阈值。在默认的 CSS 中,无论悬停状态如何,它们都会显示滚动条。单位是毫秒。

Default: 1000

# useBothWheelAxes {Boolean}

设置为 true 时,且只有一个(垂直或水平)滚动条是可视的,则垂直和水平滚动都会影响滚动条。

Default: false

# suppressScrollX {Boolean}

设置为 true 时,无论内容宽度如何,X 轴上的滚动条都将不可用。

Default: false

# suppressScrollY {Boolean}

设置为 true 时,无论内容高度如何,Y 轴上的滚动条都将不可用。

Default: false

# scrollXMarginOffset {Number}

在不启用 X 轴滚动条的情况下,内容宽度可以超过容器宽度的像素数。

Default: 0

# scrollYMarginOffset {Number}

在不启用 Y 轴滚动条的情况下,内容高度可以超过容器高度的像素数。

Default: 0

# 事件

vue-custom-scrollbar 触发的自定义事件.

# ps-scroll-y

当 y 轴向任一方向滚动时,此事件将触发。

# ps-scroll-x

当 x 轴向任一方向滚动时,此事件将触发。

# ps-scroll-up

向上滚动时会触发此事件。

# ps-scroll-down

向下滚动时会触发此事件。

# ps-scroll-left

滚动到左侧时会触发此事件。

# ps-scroll-right

滚动到右侧时会触发此事件。

# ps-y-reach-start

滚动到达 y 轴的起点时会触发此事件。

# ps-y-reach-end

当滚动到达 y 轴的末尾时,此事件将触发(对于无限滚动非常有用)。

# ps-x-reach-start

滚动到达 x 轴的起点时会触发此事件。

# ps-x-reach-end

滚动到达 x 轴末端时会触发此事件。

# 自定义样式

请参考 perfect-scrollbar(opens new window) ,然后在你的项目覆盖对应 class 的样式

# 帮助台

如果您有任何想法改进此项目或使用此项目的任何问题,请随时提交 issue(opens new window)

对于常见的问题, 这里有一个 FAQ(opens new window) 维基页面. 请在提交 issues 前查看该页面。

请理解,解决问题可能需要一段时间。上传 PR 将是解决问题的最快方法。

# IE 支持

该插件支持现代浏览器,包括 Edge 和 IE11,但在 IE11 中可能存在一些问题,主要是因为 IE 渲染错误涉及滚动属性上的同步更新。在 68 | Caveats(opens new window) 也提到了这个问题 。

不支持 IE <11,并且不接受用于修复 IE <= 10 中的问题的补丁。如果想支持旧的 IE,请 fork 此项目并在本地进行修改。

# 更多

请参考 perfect-scrollbar(opens new window)

# License

MIT(opens new window)

69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # vue-custom-scrollbar 2 | 3 | Vue.JS 的简约但完美的自定义滚动条组件(使用了 [utatti/perfect-scrollbar](https://github.com/utatti/perfect-scrollbar),所以如果遇到某些问题,可以查看 `perfect-scrollbar` 仓库) 4 | 5 | ## 为什么要自定义滚动条 6 | 7 | 众所周知,谷歌浏览器支持自定义滚动条,但是火狐或其他浏览器不支持,如果你希望你的网站更完美,就用这个组件吧~ 8 | 9 | ## 为什么要使用 vue-custom-scrollbar? 10 | 11 | `vue-custom-scrollbar` 是 Vue.JS 的一个简约但完美的自定义滚动条组件 12 | 13 | - 不改变设计布局 14 | - 不需要手动操作 DOM 15 | - 使用普通的 `scrollTop` and `scrollLeft` 16 | - 滚动条样式可完全自定义 17 | - 布局更改后更新 18 | 19 | # Demo 20 | 21 | 22 | 23 | 24 | 25 | ## 安装 26 | 27 | 安装和使用 `vue-custom-scrollbar` 的最好的方式是使用 `npm` 或者 `yarn`. 它被注册为 [vue-custom-scrollbarr](https://www.npmjs.com/package/vue-custom-scrollbar). 28 | 29 | #### npm 30 | 31 | ``` 32 | $ npm install vue-custom-scrollbar 33 | ``` 34 | 35 | ### 或者 36 | 37 | #### yarn 38 | 39 | ``` 40 | $ yarn add vue-custom-scrollbar 41 | ``` 42 | 43 | ## 警告 44 | 45 | `vue-custom-scrollbar` 可以模拟滚动条, 但不是全部类型的. 它在某些情况下也不起作用.你可以在 [Caveats](https://github.com/utatti/perfect-scrollbar/wiki/Caveats) 找到例子. 46 | 基本上,警告中列出的项目实施起来很苛刻,将来可能无法实施。如果确实需要这些功能,请考虑使用浏览器自带的滚动条 47 | 48 | ## 如何使用 49 | 50 | 实例代码: 51 | 52 | ```vue 53 | 69 | 101 | 109 | ``` 110 | 111 | ## 选项 112 | 113 | ### `swicher {Boolean}` 114 | 115 | 禁用或启用组件 116 | 117 | **Default**: `true` 118 | 119 | ### `tagname {String}` 120 | 121 | 默认组件根元素为 `section`,设置该值可修改组件根元素为其他元素,如:`div` 122 | 123 | **Default**: `section` 124 | 125 | ### `handlers {String[]}` 126 | 127 | 滚动元素的事件列表 128 | 129 | **Default**: `['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch']` 130 | 131 | ### `wheelSpeed {Number}` 132 | 133 | 鼠标滚轮事件的滚动速度 134 | 135 | **Default**: `1` 136 | 137 | ### `wheelPropagation {Boolean}` 138 | 139 | 如果此选项为 true,则当滚动到达边的末尾时,mousewheel 事件将传播到父元素。 140 | 141 | **Default**: `true` 142 | 143 | ### `swipeEasing {Boolean}` 144 | 145 | 如果此选项为 true,则会滚动得比较平缓。 146 | 147 | **Default**: `true` 148 | 149 | ### `minScrollbarLength {Number?}` 150 | 151 | 设置为整数值时,滚动条的滑块部分不会小于该像素数以下。 152 | 153 | **Default**: `null` 154 | 155 | ### `maxScrollbarLength {Number?}` 156 | 157 | 设置为整数值时,滚动条的滑块部分不会超过该像素数。 158 | 159 | **Default**: `null` 160 | 161 | ### `scrollingThreshold {Number}` 162 | 163 | 这将设置 `ps--scrolling-x` 和 `ps--scrolling-y`的停留时间阈值。在默认的 CSS 中,无论悬停状态如何,它们都会显示滚动条。单位是毫秒。 164 | 165 | **Default**: `1000` 166 | 167 | ### `useBothWheelAxes {Boolean}` 168 | 169 | 设置为 true 时,且只有一个(垂直或水平)滚动条是可视的,则垂直和水平滚动都会影响滚动条。 170 | 171 | **Default**: `false` 172 | 173 | ### `suppressScrollX {Boolean}` 174 | 175 | 设置为 true 时,无论内容宽度如何,X 轴上的滚动条都将不可用。 176 | 177 | **Default**: `false` 178 | 179 | ### `suppressScrollY {Boolean}` 180 | 181 | 设置为 true 时,无论内容高度如何,Y 轴上的滚动条都将不可用。 182 | 183 | **Default**: `false` 184 | 185 | ### `scrollXMarginOffset {Number}` 186 | 187 | 在不启用 X 轴滚动条的情况下,内容宽度可以超过容器宽度的像素数。 188 | 189 | **Default**: `0` 190 | 191 | ### `scrollYMarginOffset {Number}` 192 | 193 | 在不启用 Y 轴滚动条的情况下,内容高度可以超过容器高度的像素数。 194 | 195 | **Default**: `0` 196 | 197 | ## 事件 198 | 199 | vue-custom-scrollbar 触发的自定义事件. 200 | 201 | ### `ps-scroll-y` 202 | 203 | 当 y 轴向任一方向滚动时,此事件将触发。 204 | 205 | ### `ps-scroll-x` 206 | 207 | 当 x 轴向任一方向滚动时,此事件将触发。 208 | 209 | ### `ps-scroll-up` 210 | 211 | 向上滚动时会触发此事件。 212 | 213 | ### `ps-scroll-down` 214 | 215 | 向下滚动时会触发此事件。 216 | 217 | ### `ps-scroll-left` 218 | 219 | 滚动到左侧时会触发此事件。 220 | 221 | ### `ps-scroll-right` 222 | 223 | 滚动到右侧时会触发此事件。 224 | 225 | ### `ps-y-reach-start` 226 | 227 | 滚动到达 y 轴的起点时会触发此事件。 228 | 229 | ### `ps-y-reach-end` 230 | 231 | 当滚动到达 y 轴的末尾时,此事件将触发(对于无限滚动非常有用)。 232 | 233 | ### `ps-x-reach-start` 234 | 235 | 滚动到达 x 轴的起点时会触发此事件。 236 | 237 | ### `ps-x-reach-end` 238 | 239 | 滚动到达 x 轴末端时会触发此事件。 240 | 241 | ## 自定义样式 242 | 243 | 请参考 [perfect-scrollbar](https://github.com/utatti/perfect-scrollbar/blob/master/css/perfect-scrollbar.css),然后在你的项目覆盖对应 class 的样式 244 | 245 | ## 帮助台 246 | 247 | 如果您有任何想法改进此项目或使用此项目的任何问题,请随时提交 [issue](https://github.com/binaryify/vue-custom-scrollbar/issues) 248 | 249 | 对于常见的问题, 这里有一个 [FAQ](https://github.com/utatti/perfect-scrollbar/wiki/FAQ) 维基页面. 请在提交 issues 前查看该页面。 250 | 251 | 请理解,解决问题可能需要一段时间。上传 PR 将是解决问题的最快方法。 252 | 253 | ## IE 支持 254 | 255 | 该插件支持现代浏览器,包括 Edge 和 IE11,但在 IE11 中可能存在一些问题,主要是因为 IE 渲染错误涉及滚动属性上的同步更新。在 256 | [Caveats](https://github.com/utatti/perfect-scrollbar/wiki/Caveats) 也提到了这个问题 。 257 | 258 | 不支持 IE <11,并且不接受用于修复 IE <= 10 中的问题的补丁。如果想支持旧的 IE,请 fork 此项目并在本地进行修改。 259 | 260 | ## 更多 261 | 262 | 请参考 [perfect-scrollbar](https://github.com/utatti/perfect-scrollbar) 263 | 264 | ## License 265 | 266 | [MIT](https://github.com/Binaryify/vue-custom-scrollbar/blob/master/LICENSE) 267 | -------------------------------------------------------------------------------- /docs/azusa.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Binaryify/vue-custom-scrollbar/989eb98a8b97b3547fbd87e8816777dbd568544f/docs/azusa.jpg -------------------------------------------------------------------------------- /docs/en/README.md: -------------------------------------------------------------------------------- 1 | # vue-custom-scrollbar 2 | 3 | Minimalistic but perfect custom scrollbar component for Vue.JS(using [utatti/perfect-scrollbar](https://github.com/utatti/perfect-scrollbar), so if you have any question, you also can check the `perfect-scrollbar` repo) 4 | 5 | ## Why custom scrollbar 6 | 7 | As you know, Chrome support custom scrollbar, but Firefox or other browsers don't support it, if you want your website perfect, please use this component~ 8 | 9 | ## Why use vue-custom-scrollbar? 10 | 11 | `vue-custom-scrollbar` is minimalistic but perfect scrollbar component for Vue.JS. 12 | 13 | - No change on design layout 14 | - Don't need manipulate DOM manually 15 | - Use plain `scrollTop` and `scrollLeft` 16 | - Scrollbar style is fully customizable 17 | - Efficient update on layout change 18 | 19 | # Demo 20 | 21 | 22 | 23 | 24 | 25 | ## Install 26 | 27 | The best way to install and use `vue-custom-scrollbar` is with `npm` or `yarn`. It's registered 28 | as [vue-custom-scrollbarr](https://www.npmjs.com/package/vue-custom-scrollbar). 29 | 30 | #### npm 31 | 32 | ``` 33 | $ npm install vue-custom-scrollbar 34 | ``` 35 | 36 | ### Or 37 | 38 | #### yarn 39 | 40 | ``` 41 | $ yarn add vue-custom-scrollbar 42 | ``` 43 | 44 | ## Caveats 45 | 46 | `vue-custom-scrollbar` emulates some scrolls, but not all of the kinds. It also _does not_ work 47 | in some situations. You can find these cases in [Caveats](https://github.com/utatti/perfect-scrollbar/wiki/Caveats). 48 | Basically, items listed in the caveats are hacky to implement and may not be 49 | implemented in the future. If the features are really needed, please consider 50 | using browser-native scroll. 51 | 52 | ## How to use 53 | 54 | Example code: 55 | 56 | ```vue 57 | 64 | 87 | 95 | ``` 96 | 97 | ## Options 98 | 99 | ### `swicher {Boolean}` 100 | 101 | Enable or disable this component 102 | 103 | **Default**: `true` 104 | 105 | ### `tagname {String}` 106 | 107 | Component default root element is `section`, setting other value can change it, for example : `div` 108 | 109 | **Default**: `section` 110 | 111 | ### `handlers {String[]}` 112 | 113 | It is a list of handlers to scroll the element. 114 | 115 | **Default**: `['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch']` 116 | 117 | ### `wheelSpeed {Number}` 118 | 119 | The scroll speed applied to mousewheel event. 120 | 121 | **Default**: `1` 122 | 123 | ### `wheelPropagation {Boolean}` 124 | 125 | If this option is true, when the scroll reaches the end of the side, mousewheel 126 | event will be propagated to parent element. 127 | 128 | **Default**: `true` 129 | 130 | ### `swipeEasing {Boolean}` 131 | 132 | If this option is true, swipe scrolling will be eased. 133 | 134 | **Default**: `true` 135 | 136 | ### `minScrollbarLength {Number?}` 137 | 138 | When set to an integer value, the thumb part of the scrollbar will not shrink 139 | below that number of pixels. 140 | 141 | **Default**: `null` 142 | 143 | ### `maxScrollbarLength {Number?}` 144 | 145 | When set to an integer value, the thumb part of the scrollbar will not expand 146 | over that number of pixels. 147 | 148 | **Default**: `null` 149 | 150 | ### `scrollingThreshold {Number}` 151 | 152 | This sets threashold for `ps--scrolling-x` and `ps--scrolling-y` classes to 153 | remain. In the default CSS, they make scrollbars shown regardless of hover 154 | state. The unit is millisecond. 155 | 156 | **Default**: `1000` 157 | 158 | ### `useBothWheelAxes {Boolean}` 159 | 160 | When set to true, and only one (vertical or horizontal) scrollbar is visible 161 | then both vertical and horizontal scrolling will affect the scrollbar. 162 | 163 | **Default**: `false` 164 | 165 | ### `suppressScrollX {Boolean}` 166 | 167 | When set to true, the scroll bar in X axis will not be available, regardless of 168 | the content width. 169 | 170 | **Default**: `false` 171 | 172 | ### `suppressScrollY {Boolean}` 173 | 174 | When set to true, the scroll bar in Y axis will not be available, regardless of 175 | the content height. 176 | 177 | **Default**: `false` 178 | 179 | ### `scrollXMarginOffset {Number}` 180 | 181 | The number of pixels the content width can surpass the container width without 182 | enabling the X axis scroll bar. 183 | 184 | **Default**: `0` 185 | 186 | ### `scrollYMarginOffset {Number}` 187 | 188 | The number of pixels the content height can surpass the container height without 189 | enabling the Y axis scroll bar. 190 | 191 | **Default**: `0` 192 | 193 | ## Events 194 | 195 | vue-custom-scrollbar dispatches custom events. 196 | 197 | ### `ps-scroll-y` 198 | 199 | This event fires when the y-axis is scrolled in either direction. 200 | 201 | ### `ps-scroll-x` 202 | 203 | This event fires when the x-axis is scrolled in either direction. 204 | 205 | ### `ps-scroll-up` 206 | 207 | This event fires when scrolling upwards. 208 | 209 | ### `ps-scroll-down` 210 | 211 | This event fires when scrolling downwards. 212 | 213 | ### `ps-scroll-left` 214 | 215 | This event fires when scrolling to the left. 216 | 217 | ### `ps-scroll-right` 218 | 219 | This event fires when scrolling to the right. 220 | 221 | ### `ps-y-reach-start` 222 | 223 | This event fires when scrolling reaches the start of the y-axis. 224 | 225 | ### `ps-y-reach-end` 226 | 227 | This event fires when scrolling reaches the end of the y-axis (useful for 228 | infinite scroll). 229 | 230 | ### `ps-x-reach-start` 231 | 232 | This event fires when scrolling reaches the start of the x-axis. 233 | 234 | ### `ps-x-reach-end` 235 | 236 | This event fires when scrolling reaches the end of the x-axis. 237 | 238 | ## Custom style 239 | 240 | Please refer to [perfect-scrollbar](https://github.com/utatti/perfect-scrollbar/blob/master/css/perfect-scrollbar.css), then override the corresponding class style in your project 241 | 242 | ## Helpdesk 243 | 244 | If you have any idea to improve this project or any problem using this, please 245 | feel free to upload an [issue](https://github.com/utatti/perfect-scrollbar/issues). 246 | 247 | For common problems, there is a [FAQ](https://github.com/utatti/perfect-scrollbar/wiki/FAQ) wiki 248 | page. Please check the page before uploading an issue. 249 | 250 | Uploading a PR would be the fastest way to fix an issue. 251 | 252 | ## IE Support 253 | 254 | The plugin support modern browsers including Edge and IE11, 255 | but may have some issues in IE11 mainly because of IE rendering bug concerning 256 | sync update on scroll properties. The problem is mentioned in 257 | [Caveats](https://github.com/utatti/perfect-scrollbar/wiki/Caveats) too. 258 | 259 | IE<11 is not supported, and patches to fix problems in IE<=10 will not be 260 | accepted. When old IEs should be supported, please fork the project and make 261 | modification locally. 262 | 263 | ## More 264 | 265 | Please refer to [perfect-scrollbar](https://github.com/utatti/perfect-scrollbar) 266 | 267 | ## License 268 | 269 | [MIT](https://github.com/Binaryify/vue-custom-scrollbar/blob/master/LICENSE) 270 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-custom-scrollbar", 3 | "version": "1.4.4", 4 | "scripts": { 5 | "serve": "vue-cli-service serve", 6 | "build": "vue-cli-service build --target lib --name vueScrollbar src/vue-scrollbar.vue", 7 | "docs:dev": "vuepress dev docs", 8 | "docs:build": "vuepress build docs" 9 | }, 10 | "dependencies": { 11 | "perfect-scrollbar": "^1.5.3", 12 | "vue": "^2.6.11" 13 | }, 14 | "main": "dist/vueScrollbar.umd.min.js", 15 | "devDependencies": { 16 | "@vue/cli-plugin-babel": "4.5.6", 17 | "@vue/cli-service": "4.5.6", 18 | "vue-template-compiler": "^2.6.12", 19 | "vuepress": "1.6.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Binaryify/vue-custom-scrollbar/989eb98a8b97b3547fbd87e8816777dbd568544f/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | vue-perfect-scrollbar 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import vuePerfectScrollbar from './vue-scrollbar' 2 | export default vuePerfectScrollbar 3 | -------------------------------------------------------------------------------- /src/vue-scrollbar.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // css: { extract: false } 3 | } 4 | --------------------------------------------------------------------------------