vue-scrollto
vue-scrollto copied to clipboard
Can we use actual html element or even "ref" for the scrollTo target?
From the examples, it seems we always need to pass in a string of the target HTML ID? If this is not true, can you please update the docs so that it's not a hunting show when trying to figure this out?
Thanks
https://github.com/rigor789/vue-scrollto/blob/197b365e2914b0e47470d1d10ffc6bfc127a4151/src/utils.js#L13-L18
is what resolves the target - I guess passing an html element, or a ref would also work, but I have not tested this directly (across different browsers).
I don't currently have the capacity to work on this, but if you can test it across browsers, feel free to do so, and let me know how it goes.
Thanks! Unfortunately, I don't have space currently for a complete test, but I'll leave feedback when I do.
For the moment I'm just generating dynamic ids for my elements and that works like a charm.
I'm using this.$scrollTo(this.$refs['myReference'])
just fine. this.$refs.myReference
works too, but is giving me an argument warning in WebStorm.