Try fixing router v2

This commit is contained in:
Dominik Korsa 2019-08-29 21:18:53 +02:00
parent 7810af56ef
commit 15121000e8
2 changed files with 7 additions and 7 deletions

View file

@ -14,11 +14,4 @@
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
<script>
const redirect = sessionStorage.redirect;
delete sessionStorage.redirect;
if (redirect && redirect != location.href) {
history.replaceState(null, null, redirect);
}
</script>
</html> </html>

View file

@ -30,4 +30,11 @@ Vue.config.productionTip = false;
new Vue({ new Vue({
router, router,
render: h => h(App), render: h => h(App),
created() {
if (sessionStorage.redirect) {
const { redirect } = sessionStorage;
delete sessionStorage.redirect;
this.$router.push(redirect);
}
},
}).$mount('#app'); }).$mount('#app');