Skip to content

Commit

Permalink
fix: 语言设置响应式
Browse files Browse the repository at this point in the history
  • Loading branch information
xpyjs committed Jul 1, 2024
1 parent c4b46a4 commit a2ac28b
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/components/root/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ import GanttBody from '@/components/container/GanttBody.vue';
import useSlotsBox from '@/composables/useSlotsBox';
import useTableWidth from '@/composables/useTableWidth';
import { uuid } from '@/utils/common';
import { DefineComponent, onMounted, onUpdated, Ref, ref, toRefs } from 'vue';
import {
DefineComponent,
onMounted,
onUpdated,
Ref,
ref,
toRefs,
watch
} from 'vue';
import rootProps from './rootProps';
import useData from '@/composables/useData';
import useStyle from '@/composables/useStyle';
Expand All @@ -90,7 +98,14 @@ const containerId = uuid(10);
const props = defineProps(rootProps);
// 本地化
setLocale(props.locale);
watch(
() => props.locale,
() => setLocale(props.locale),
{
immediate: true
}
);
// setLocale(props.locale);
// #region 挂载实例
const { rootRef } = useRoot();
Expand Down

0 comments on commit a2ac28b

Please sign in to comment.