[Page Navigation]

- working page navigation between ItemModel and LoginPage
- ItemModel first loaded on website access
- resizing variables because of client sided loading change in sizes
- cleanup of links in navbar (only ItemModel / LoginPage)
This commit is contained in:
Luis S. Ruisinger
2022-07-14 22:41:26 +02:00
parent 4e0e9f4119
commit 6a34c67f56
4 changed files with 743 additions and 70 deletions

View File

@@ -1,17 +1,41 @@
<template>
<div id="app">
<ItemModel/>
</div>
</template>
<script>
import ItemModel from "@/components/ItemModel";
import LoginPage from "@/components/LoginPage";
import Custom404Page from "@/components/Custom404Page";
const routes = {
'/': ItemModel,
'/login': LoginPage
}
export default {
components: {
ItemModel
data() {
return {
currentPath: window.location.hash
}
},
computed: {
currentView() {
return routes[this.currentPath.slice(1) || '/'] || Custom404Page
}
},
mounted() {
window.addEventListener('hashchange', () => {
this.currentPath = window.location.hash
})
}
};
}
</script>
<template>
<component :is="currentView" />
</template>
<style>
[v-cloak] {
display: none;