|
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 |
| -<template> |
33 |
| - <div> |
34 |
| - <vue-custom-scrollbar class="scroll-area" :settings="settings" @ps-scroll-y="scrollHanle"> |
35 |
| - <img src="http://utatti.github.io/perfect-scrollbar/azusa.jpg" height="720" width="1280" alt=""> |
36 |
| - </vue-custom-scrollbar> |
37 |
| - </div> |
38 |
| -</template> |
39 |
| -<script> |
40 |
| -import vueCustomScrollbar from 'vue-custom-scrollbar' |
41 |
| -export default { |
42 |
| - components: { |
43 |
| - vueCustomScrollbar |
44 |
| - }, |
45 |
| - data() { |
46 |
| - return { |
47 |
| - settings: { |
48 |
| - suppressScrollY: false, |
49 |
| - suppressScrollX: false, |
50 |
| - wheelPropagation: false |
51 |
| - } |
52 |
| - } |
53 |
| - }, |
54 |
| - methods: { |
55 |
| - scrollHanle(evt) { |
56 |
| - console.log(evt) |
57 |
| - } |
58 |
| - } |
59 |
| -} |
60 |
| -</script> |
61 |
| -<style > |
62 |
| -.scroll-area { |
63 |
| - position: relative; |
64 |
| - margin: auto; |
65 |
| - width: 600px; |
66 |
| - height: 400px; |
67 |
| -} |
68 |
| -</style> |
69 |
| -``` |
70 |
| - |
71 |
| -## License |
72 |
| - |
73 |
| -[MIT](https://github.com/Binaryify/vue-custom-scrollbar/blob/master/LICENSE) |
| 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 | +<template> |
| 33 | + <div> |
| 34 | + <vue-custom-scrollbar class="scroll-area" :settings="settings" @ps-scroll-y="scrollHanle"> |
| 35 | + <img src="http://utatti.github.io/perfect-scrollbar/azusa.jpg" height="720" width="1280" alt=""> |
| 36 | + </vue-custom-scrollbar> |
| 37 | +</div> |
| 38 | +</template> |
| 39 | +<script> |
| 40 | +import vueCustomScrollbar from 'vue-custom-scrollbar' |
| 41 | +import "vue-custom-scrollbar/dist/vueScrollbar.css" |
| 42 | +export default { |
| 43 | + components: { |
| 44 | + vueCustomScrollbar |
| 45 | + }, |
| 46 | + data() { |
| 47 | + return { |
| 48 | + settings: { |
| 49 | + suppressScrollY: false, |
| 50 | + suppressScrollX: false, |
| 51 | + wheelPropagation: false |
| 52 | + } |
| 53 | + } |
| 54 | + }, |
| 55 | + methods: { |
| 56 | + scrollHanle(evt) { |
| 57 | + console.log(evt) |
| 58 | + } |
| 59 | + } |
| 60 | +} |
| 61 | +</script> |
| 62 | +<style > |
| 63 | +.scroll-area { |
| 64 | + position: relative; |
| 65 | + margin: auto; |
| 66 | + width: 600px; |
| 67 | + height: 400px; |
| 68 | +} |
| 69 | +</style> |
| 70 | +``` |
| 71 | + |
| 72 | +## License |
| 73 | + |
| 74 | +[MIT](https://github.com/Binaryify/vue-custom-scrollbar/blob/master/LICENSE) |
0 commit comments