Created
January 4, 2018 12:09
-
-
Save Bewitchedyegor/1e9c70d7760f9e42677829aafc754ade to your computer and use it in GitHub Desktop.
Add hash to current link inside browser address bar without reloading the page
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
| <template> | |
| <a href="#cfd" @click="updateLink()"> | |
| </template> | |
| <script> | |
| export default { | |
| methods: { | |
| updateLink: function() { | |
| var href = event.currentTarget.getAttribute('href'); | |
| history.pushState("", "", "cfd_products"+href); | |
| } | |
| } | |
| } | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment