Skip to content

Commit

Permalink
Provide scrollbar instance link
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Gritsenko committed Dec 31, 2018
1 parent 9a7949c commit b1dcb9d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Vue Smooth Scrollbar
Smooth Scrollbar for Vue.js projects
Smooth Scrollbar for Vue.js projects. Based on [@idiotwu's smooth-scrollbar](https://idiotwu.github.io/smooth-scrollbar/).
## Usage
### 1. Install dependency

Expand Down Expand Up @@ -37,3 +37,13 @@ Vue.use(SmoothScrollbar)
}
</style>
```

## Backlog
* [x] Plugin structure
* [x] Basic implementation
* [x] Options
* [ ] Events
* [x] Methods
* [ ] Styling
* [ ] Build dist
* [ ] SSR / nuxt
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-smooth-scrollbar",
"version": "0.1.1",
"version": "0.1.2",
"description": "Smooth scrollbar for Vue.js projects",
"main": "src/index.js",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions src/SmoothScrollbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,23 @@
default: () => ({})
}
},
data() {
return {
scrollbar: null
}
},
mounted() {
scrollbar = SmoothScrollbar.init(
this.$refs.scrollArea,
Object.assign({}, this.defaultOptions, this.globalOptions, this.options)
)
this.scrollbar = scrollbar

This comment has been minimized.

Copy link
@magisters-cc

magisters-cc Jan 1, 2019

Owner

Thinking about another way of providing scrollbar instance link, because of Vue adding reactivity.

},
destroyed() {
scrollbar.destroy()
scrollbar = null
this.scrollbar = null
}
}
</script>
Expand Down

0 comments on commit b1dcb9d

Please sign in to comment.