Created
January 5, 2024 09:11
-
-
Save kp-gists/f02e49556004a264efd33d0dbde9a96e to your computer and use it in GitHub Desktop.
vue scroll to element
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // scroll to categories | |
| const hash = this.$route.query.hash | |
| if (hash == 'categories') { | |
| console.log('🚀 ~ hash:', hash) | |
| const el = document.getElementById('categories') | |
| el.scrollIntoView({ behavior: 'smooth' }) | |
| this.$router.replace({ query: null }) | |
| } else { | |
| console.log('this.$route.params', this.$route.query) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment