mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
feat: 完成主题切换,语言切换的本地存储
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
import LangSelect from './index.vue';
|
||||
|
||||
export { LangSelect };
|
||||
@@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<n-dropdown
|
||||
trigger="hover"
|
||||
@select="handleSelect"
|
||||
:show-arrow="true"
|
||||
:options="options"
|
||||
>
|
||||
<n-button quaternary>
|
||||
<n-icon size="20" :depth="1">
|
||||
<LanguageIcon />
|
||||
</n-icon>
|
||||
</n-button>
|
||||
</n-dropdown>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useLangStore } from '@/store/modules/langStore/langStore'
|
||||
import { Language as LanguageIcon } from '@vicons/ionicons5'
|
||||
import { langList } from '@/settings/designSetting'
|
||||
import { LangEnum } from '@/enums/styleEnum'
|
||||
|
||||
const langStore = useLangStore()
|
||||
const options = langList
|
||||
|
||||
const handleSelect = (key: LangEnum) => {
|
||||
langStore.changeLang(key)
|
||||
}
|
||||
</script>
|
||||
@@ -1,12 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
<n-button quaternary @click="changeTheme">
|
||||
<n-icon size="20" :depth="1">
|
||||
<MoonIcon v-if="designStore.darkTheme" />
|
||||
<SunnyIcon v-else />
|
||||
</n-icon>
|
||||
</n-button>
|
||||
</div>
|
||||
<n-button quaternary @click="changeTheme">
|
||||
<n-icon size="20" :depth="1">
|
||||
<MoonIcon v-if="designStore.darkTheme" />
|
||||
<SunnyIcon v-else />
|
||||
</n-icon>
|
||||
</n-button>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
Reference in New Issue
Block a user