[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user