Replace generic a.href to RouterLink

This commit is contained in:
CakesTwix 2024-09-23 21:43:14 +03:00
parent 4cc6c79180
commit 5d7741ee3a
Signed by: CakesTwix
GPG key ID: 7B11051D5CE19825
2 changed files with 9 additions and 14 deletions

View file

@ -1,8 +1,3 @@
<script setup lang="ts">
const pathname = location.pathname
</script>
<template>
<nav class="left drawer primary-text">
<header>
@ -11,24 +6,24 @@ const pathname = location.pathname
<h6>Toloka2Web MD3</h6>
</nav>
</header>
<a :class="(pathname == '/') ? 'active' : ''" href="/">
<RouterLink :class="($route.path == '/') ? 'active' : ''" to="/">
<i>home</i>
<div>Головна</div>
</a>
<a :class="(pathname == '/add') ? 'active' : ''" href="/add">
</RouterLink>
<RouterLink :class="($route.path == '/add') ? 'active' : ''" to="/add">
<i>add</i>
<div>Додати</div>
</a>
<a :class="(pathname == '/settings') ? 'active' : ''" href="/settings">
</RouterLink>
<RouterLink :class="($route.path == '/settings') ? 'active' : ''" to="/settings">
<i>settings</i>
<div>Налаштування</div>
</a>
</RouterLink>
<div class="divider small-margin"></div>
<label>Інше</label>
<a :class="(pathname == '/about') ? 'active' : ''" href="/about">
<RouterLink :class="($route.path == '/about') ? 'active' : ''" to="/about">
<i>person</i>
<div>Про застосунок</div>
</a>
</RouterLink>
</nav>
<nav class="left m">
<header>

View file

@ -20,7 +20,7 @@
<article class="secondary-text">
<a class="row wave"><i>title</i> Toloka2Web v2 Vue Version</a>
<hr>
<a class="row wave"><i>conversion_path</i> v1.0.1</a>
<a class="row wave"><i>conversion_path</i> v1.0.2</a>
</article>
</template>