generated from xiaoluoboding/chrome-ext-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFooter.vue
29 lines (24 loc) · 897 Bytes
/
Footer.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<template>
<nav class="text-xl mt-6">
<button class="icon-btn mx-2 !outline-none" :title="$t('button.toggle_dark')" @click="e => toggleDark()">
<carbon-moon v-if="isDark" />
<carbon-sun v-else />
</button>
<a class="icon-btn mx-2" :title="$t('button.toggle_langs')" @click="toggleLocales">
<carbon-language />
</a>
<a class="icon-btn mx-2" rel="noreferrer" href="https://github.com/xiaoluoboding/vitesse-chrome-extension" target="_blank" title="GitHub">
<carbon-logo-github />
</a>
</nav>
</template>
<script setup lang="ts">
import { useI18n } from 'vue-i18n'
import { isDark, toggleDark } from '~/logic'
const { availableLocales, locale } = useI18n()
const toggleLocales = () => {
// change to some real logic
const locales = availableLocales
locale.value = locales[(locales.indexOf(locale.value) + 1) % locales.length]
}
</script>