2025-08-07 15:16:23 +08:00
|
|
|
<template>
|
|
|
|
|
<a-config-provider :locale="antdLocal">
|
|
|
|
|
<router-view></router-view>
|
|
|
|
|
</a-config-provider>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import {useStore} from "vuex";
|
|
|
|
|
import {computed, defineComponent, ref} from "vue";
|
2025-11-03 16:40:10 +08:00
|
|
|
import zhCN from '@hwork/ant-design-vue/es/locale/zh_CN';
|
|
|
|
|
import enUS from '@hwork/ant-design-vue/es/locale/en_US';
|
2025-08-07 15:16:23 +08:00
|
|
|
import dayjs from "dayjs";
|
|
|
|
|
import "dayjs/locale/zh-cn";
|
|
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
name: 'App',
|
|
|
|
|
setup() {
|
|
|
|
|
|
|
|
|
|
const store = useStore()
|
|
|
|
|
const language = computed(() => store.getters['language'])
|
|
|
|
|
const color = computed(() => store.getters.color);
|
|
|
|
|
|
|
|
|
|
const antdLocal = ref(
|
|
|
|
|
computed(() => {
|
|
|
|
|
switch (language.value) {
|
|
|
|
|
case 'zh-cn':
|
|
|
|
|
dayjs.locale(zhCN.locale);
|
|
|
|
|
return zhCN;
|
|
|
|
|
case 'en-us':
|
|
|
|
|
dayjs.locale(enUS.locale);
|
|
|
|
|
return enUS;
|
|
|
|
|
default:
|
|
|
|
|
dayjs.locale(zhCN.locale);
|
|
|
|
|
return zhCN;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
antdLocal,
|
|
|
|
|
dayjs
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|