|
1 | 1 | <script lang="ts" setup>
|
2 | 2 | import { computed, ref } from 'vue'
|
3 |
| -import { NButton, NInput, NPopconfirm, useMessage } from 'naive-ui' |
| 3 | +import { NButton, NInput, NPopconfirm, NSelect, useMessage } from 'naive-ui' |
4 | 4 | import type { Language, Theme } from '@/store/modules/app/helper'
|
5 | 5 | import { SvgIcon } from '@/components/common'
|
6 | 6 | import { useAppStore, useUserStore } from '@/store'
|
7 | 7 | import type { UserInfo } from '@/store/modules/user/helper'
|
8 | 8 | import { getCurrentDate } from '@/utils/functions'
|
| 9 | +import { useBasicLayout } from '@/hooks/useBasicLayout' |
9 | 10 | import { t } from '@/locales'
|
10 | 11 |
|
11 | 12 | const appStore = useAppStore()
|
12 | 13 | const userStore = useUserStore()
|
13 | 14 |
|
| 15 | +const { isMobile } = useBasicLayout() |
| 16 | +
|
14 | 17 | const ms = useMessage()
|
15 | 18 |
|
16 | 19 | const theme = computed(() => appStore.theme)
|
@@ -148,7 +151,10 @@ function handleImportButtonClick(): void {
|
148 | 151 | </NButton>
|
149 | 152 | </div>
|
150 | 153 |
|
151 |
| - <div class="flex items-center space-x-4"> |
| 154 | + <div |
| 155 | + class="flex items-center space-x-4" |
| 156 | + :class="isMobile && 'items-start'" |
| 157 | + > |
152 | 158 | <span class="flex-shrink-0 w-[100px]">{{ $t('setting.chatHistory') }}</span>
|
153 | 159 |
|
154 | 160 | <div class="flex flex-wrap items-center gap-4">
|
@@ -199,15 +205,12 @@ function handleImportButtonClick(): void {
|
199 | 205 | <div class="flex items-center space-x-4">
|
200 | 206 | <span class="flex-shrink-0 w-[100px]">{{ $t('setting.language') }}</span>
|
201 | 207 | <div class="flex flex-wrap items-center gap-4">
|
202 |
| - <template v-for="item of languageOptions" :key="item.key"> |
203 |
| - <NButton |
204 |
| - size="small" |
205 |
| - :type="item.key === language ? 'primary' : undefined" |
206 |
| - @click="appStore.setLanguage(item.key)" |
207 |
| - > |
208 |
| - {{ item.label }} |
209 |
| - </NButton> |
210 |
| - </template> |
| 208 | + <NSelect |
| 209 | + style="width: 140px" |
| 210 | + :value="language" |
| 211 | + :options="languageOptions" |
| 212 | + @update-value="value => appStore.setLanguage(value)" |
| 213 | + /> |
211 | 214 | </div>
|
212 | 215 | </div>
|
213 | 216 | <div class="flex items-center space-x-4">
|
|
0 commit comments