|
|
|
@ -1,31 +1,7 @@
|
|
|
|
|
<script>
|
|
|
|
|
import PagePrincipale from './components/PagePrincipale.vue';
|
|
|
|
|
import Titre from './components/Titre.vue'
|
|
|
|
|
import NotFound from './components/erreurs/NotFound.vue';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const routes = {
|
|
|
|
|
'/': PagePrincipale,
|
|
|
|
|
'/about': PagePrincipale
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
currentPath: window.location.hash
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
currentView() {
|
|
|
|
|
return routes[this.currentPath.slice(1) || '/'] || NotFound;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
window.addEventListener('hashchange', () => {
|
|
|
|
|
this.currentPath = window.location.hash;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
components: { Titre }
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
@ -36,7 +12,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
<main>
|
|
|
|
|
<!-- todo -->
|
|
|
|
|
<component :is="currentView" />
|
|
|
|
|
<router-view></router-view>
|
|
|
|
|
</main>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|