Skip to content

Commit

Permalink
feat: default display of map
Browse files Browse the repository at this point in the history
  • Loading branch information
bolinocroustibat committed Dec 2, 2024
1 parent a4b1a49 commit 40c1b7e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
18 changes: 14 additions & 4 deletions frontend/src/components/HeaderComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<p class="tagline">Obtenez une vue d'ensemble des terres vendues, classées par typologie, et accédez rapidement aux détails spécifiques de chaque transaction, incluant son prix et sa classification</p>
</div>
<nav class="navigation">
<router-link to="/map" class="nav-link">Carte</router-link>
<router-link to="/" :class="{ active: isMapRoute }" class="nav-link">Carte</router-link>
<router-link to="/tableau" class="nav-link">Tableau</router-link>
<router-link to="/questions" class="nav-link">Questions</router-link>
</nav>
Expand All @@ -15,11 +15,21 @@
</template>

<script lang="ts">
import { defineComponent } from "vue";
import { defineComponent, computed } from 'vue'
import { useRoute } from 'vue-router'
export default defineComponent({
name: "HeaderComponent",
});
setup() {
const route = useRoute()
const isMapRoute = computed(() => {
return route.path === '/' || route.path === '/map'
})
return {
isMapRoute
}
}
})
</script>

<style>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import TableauView from '../views/TableauView.vue'
import QuestionsView from '../views/QuestionsView.vue'

const router = createRouter({
history: createWebHistory(),
history: createWebHistory('/terrains-connus/'),
routes: [
{
path: '/',
redirect: '/map'
redirect: '/carte'
},
{
path: '/map',
name: 'map',
path: '/carte',
name: 'carte',
component: MapView
},
{
Expand Down

0 comments on commit 40c1b7e

Please sign in to comment.