mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-11-02 16:57:11 +08:00
升级:arco-design-pro-vue => 2.6.1(优化语言切换及修复若干问题)
This commit is contained in:
@@ -53,6 +53,9 @@
|
||||
:key="item.value"
|
||||
:value="item.value"
|
||||
>
|
||||
<template #icon>
|
||||
<icon-check v-show="item.value === currentLocale" />
|
||||
</template>
|
||||
{{ item.label }}
|
||||
</a-doption>
|
||||
</template>
|
||||
@@ -196,7 +199,7 @@
|
||||
const appStore = useAppStore();
|
||||
const loginStore = useLoginStore();
|
||||
const { logout } = useUser();
|
||||
const { changeLocale } = useLocale();
|
||||
const { changeLocale, currentLocale } = useLocale();
|
||||
const { isFullscreen, toggle: toggleFullScreen } = useFullscreen();
|
||||
const locales = [...LOCALE_OPTIONS];
|
||||
const theme = computed(() => {
|
||||
|
||||
@@ -8,6 +8,9 @@ export default function useLocale() {
|
||||
return i18.locale.value;
|
||||
});
|
||||
const changeLocale = (value: string) => {
|
||||
if (i18.locale.value === value) {
|
||||
return;
|
||||
}
|
||||
i18.locale.value = value;
|
||||
localStorage.setItem('arco-locale', value);
|
||||
Message.success(i18.t('navbar.action.locale'));
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, watch, provide } from 'vue';
|
||||
import { ref, computed, watch, provide, onMounted } from 'vue';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import { useAppStore, useLoginStore } from '@/store';
|
||||
import NavBar from '@/components/navbar/index.vue';
|
||||
@@ -56,6 +56,7 @@
|
||||
import useResponsive from '@/hooks/responsive';
|
||||
import PageLayout from './page-layout.vue';
|
||||
|
||||
const isInit = ref(false);
|
||||
const appStore = useAppStore();
|
||||
const loginStore = useLoginStore();
|
||||
const router = useRouter();
|
||||
@@ -82,6 +83,7 @@
|
||||
return { ...paddingLeft, ...paddingTop };
|
||||
});
|
||||
const setCollapsed = (val: boolean) => {
|
||||
if (!isInit.value) return; // for page initialization menu state problem
|
||||
appStore.updateSettings({ menuCollapse: val });
|
||||
};
|
||||
watch(
|
||||
@@ -98,6 +100,9 @@
|
||||
provide('toggleDrawerMenu', () => {
|
||||
drawerVisible.value = !drawerVisible.value;
|
||||
});
|
||||
onMounted(() => {
|
||||
isInit.value = true;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
|
||||
@@ -496,7 +496,7 @@
|
||||
}).catch(() => {
|
||||
proxy.$notification.warning({
|
||||
title: '警告',
|
||||
content: "如果您正在访问演示环境,点击导出会报错。这是由于演示环境开启了 Mock.js,而 Mock.js 会将 responseType 设置为 '',不仅会导致关键判断出错,也会导致导出的文件无法打开。",
|
||||
content: "如果您正在访问演示环境,点击导出会报错。这是由于演示环境开启了 Mock.js,而 Mock.js 会将 responseType 设置为 '',这不仅会导致关键判断出错,也会导致导出的文件无法打开。",
|
||||
duration: 10000,
|
||||
closable: true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user