ibufu / vue2-scrollspy

Scrollspy for Vue2
https://ibufu.github.io/vue2-scrollspy/
MIT License
135 stars 32 forks source link

Accepting options (time, steps, offset...) #6

Closed grzhan closed 6 years ago

grzhan commented 7 years ago

In vue-scrollspy , we can set animation options like this:

<div v-scrollspy="scrollPos" :steps="30" :time="200" :offset="10">

However in vue2-scrollspy , these parameters are constants, we can't tune them by ourselves.

I hope vue2-scrollspy would accept such options.

In addition, maybe we should use a component rather than a directive to implement "scroll-spy", see https://github.com/vuejs/vue/issues/862:

Directives in Vue2 are supposed to only handle simple mapping of a data property to some DOM manipulation. If you want to have something that encapsulates more complex behavior, especially accepting options, you should just use a component instead.

I would appreciate it if you could give me an early reply.

ibufu commented 7 years ago

There will be a breaking change if turn it to a component. And it need more time to redesign. I will consider it later.

exnihilo-creatio commented 6 years ago

@ibufu The component can come later. It would be nice to have the options available sooner.