// App.vue
export default {
// ...
created() {
window.pageStack = this.pageStack; // pageStack global due to backbutton management in index.html (for mobile devices)
this.start()
},
// ...
}
<!-- index.html -->
<script>
window.addEventListener('load', function () {
window.history.pushState({}, '')
});
window.addEventListener('popstate', function () {
if (window.pageStack.length > 2) {
window.pageStack.pop();
window.history.pushState({}, '')
}
})
</script>