rename modules according to rules

This commit is contained in:
2022-07-22 01:01:21 +02:00
parent 6d6d060d5b
commit 11c1e022b6
51 changed files with 6 additions and 6 deletions

43
client/src/App.vue Normal file
View File

@@ -0,0 +1,43 @@
<script>
import ItemModel from "@/components/ItemModel";
import LoginPage from "@/components/LoginPage";
import Custom404Page from "@/components/Custom404Page";
const routes = {
'/': ItemModel,
'/login': LoginPage
}
export default {
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;
}
</style>