Created
September 8, 2018 12:33
-
-
Save tajnymag/ddfa854d60931ab5c3e623b6fd3a7713 to your computer and use it in GitHub Desktop.
Suuuuuuuuper simple reactive hash router
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
const app = new Vue({ | |
el: 'my-app', | |
data() { | |
return { | |
current_path: window.location.hash | |
} | |
} | |
}); | |
window.addEventListener('hashchange', () => { | |
app.current_path = window.location.hash; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment