vue-scrollto icon indicating copy to clipboard operation
vue-scrollto copied to clipboard

Can we use actual html element or even "ref" for the scrollTo target?

Open vitality82 opened this issue 4 years ago • 3 comments

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

vitality82 avatar Oct 25 '19 12:10 vitality82

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.

rigor789 avatar Oct 25 '19 15:10 rigor789

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.

vitality82 avatar Oct 25 '19 20:10 vitality82

I'm using this.$scrollTo(this.$refs['myReference']) just fine. this.$refs.myReference works too, but is giving me an argument warning in WebStorm.

scopendo avatar Nov 22 '19 12:11 scopendo