Files
vue-starter/src/view/navbar/switch-lang.vue
kgdxpr e7ac2c7a69 INIT
2025-08-28 09:37:00 +08:00

24 lines
524 B
Vue

<template>
<div class="switch-lang-container" @click="onClick">
<span>{{ langStore.currentLang === "zh-cn" ? "EN" : "CN" }}</span>
</div>
</template>
<script setup lang="ts">
import { useLangStore } from '@/store';
import { LangType } from '@/types';
const langStore = useLangStore();
const onClick = () => {
if (langStore.currentLang === LangType.CN) {
langStore.updateCurrentLang(LangType.EN);
} else {
langStore.updateCurrentLang(LangType.CN);
}
};
</script>
<style scoped lang="scss">
</style>