mirror of
https://github.com/thelounge/thelounge
synced 2024-11-23 04:23:13 +00:00
dd05ee3a65
Co-authored-by: Eric Nemchik <eric@nemchik.com> Co-authored-by: Pavel Djundik <xPaw@users.noreply.github.com>
43 lines
801 B
Vue
43 lines
801 B
Vue
<template>
|
|
<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"
|
|
>
|
|
{{ name }}
|
|
</button>
|
|
</router-link>
|
|
</li>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import {defineComponent} from "vue";
|
|
import {useRoute} from "vue-router";
|
|
|
|
export default defineComponent({
|
|
name: "SettingTabListItem",
|
|
props: {
|
|
name: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
className: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
to: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
},
|
|
setup() {
|
|
const route = useRoute();
|
|
|
|
return {
|
|
route,
|
|
};
|
|
},
|
|
});
|
|
</script>
|