2022-02-19 00:45:25 +00:00
|
|
|
<template>
|
2022-06-19 00:25:21 +00:00
|
|
|
<li :aria-label="name" role="tab" :aria-selected="route.name === name" aria-controls="settings">
|
|
|
|
<router-link v-slot:default="{navigate, isExactActive}" :to="'/settings/' + to" custom>
|
|
|
|
<button
|
|
|
|
:class="['icon', className, {active: isExactActive}]"
|
|
|
|
@click="navigate"
|
|
|
|
@keypress.enter="navigate"
|
|
|
|
>
|
2022-02-19 00:45:25 +00:00
|
|
|
{{ name }}
|
|
|
|
</button>
|
|
|
|
</router-link>
|
|
|
|
</li>
|
|
|
|
</template>
|
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import {defineComponent} from "vue";
|
|
|
|
import {useRoute} from "vue-router";
|
|
|
|
|
|
|
|
export default defineComponent({
|
2022-02-19 00:45:25 +00:00
|
|
|
name: "SettingTabListItem",
|
|
|
|
props: {
|
|
|
|
name: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
className: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
to: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
2022-06-19 00:25:21 +00:00
|
|
|
setup() {
|
|
|
|
const route = useRoute();
|
|
|
|
|
|
|
|
return {
|
|
|
|
route,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|
2022-02-19 00:45:25 +00:00
|
|
|
</script>
|