Skip to content

Instantly share code, notes, and snippets.

@tajnymag
Created September 8, 2018 12:33
Show Gist options
  • Save tajnymag/ddfa854d60931ab5c3e623b6fd3a7713 to your computer and use it in GitHub Desktop.
Save tajnymag/ddfa854d60931ab5c3e623b6fd3a7713 to your computer and use it in GitHub Desktop.
Suuuuuuuuper simple reactive hash router
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