diff --git a/packages/@core/ui-kit/form-ui/src/types.ts b/packages/@core/ui-kit/form-ui/src/types.ts index 25b4c7ee2..07a2afd43 100644 --- a/packages/@core/ui-kit/form-ui/src/types.ts +++ b/packages/@core/ui-kit/form-ui/src/types.ts @@ -4,7 +4,7 @@ import type { ZodTypeAny } from 'zod'; import type { Component, HtmlHTMLAttributes, Ref } from 'vue'; import type { VbenButtonProps } from '@vben-core/shadcn-ui'; -import type { ClassType, Nullable } from '@vben-core/typings'; +import type { ClassType, MaybeComputedRef, Nullable } from '@vben-core/typings'; import type { FormApi } from './form-api'; @@ -316,7 +316,7 @@ export interface FormRenderProps< export interface ActionButtonOptions extends VbenButtonProps { [key: string]: any; - content?: string; + content?: MaybeComputedRef; show?: boolean; } diff --git a/packages/effects/layouts/src/basic/layout.vue b/packages/effects/layouts/src/basic/layout.vue index 502c42131..1fb90448f 100644 --- a/packages/effects/layouts/src/basic/layout.vue +++ b/packages/effects/layouts/src/basic/layout.vue @@ -6,7 +6,7 @@ import type { MenuRecordRaw } from '@vben/types'; import { computed, useSlots, watch } from 'vue'; import { useRefresh } from '@vben/hooks'; -import { $t } from '@vben/locales'; +import { $t, i18n } from '@vben/locales'; import { preferences, updatePreferences, @@ -163,7 +163,8 @@ watch( ); // 语言更新后,刷新页面 -watch(() => preferences.app.locale, refresh, { flush: 'post' }); +// i18n.global.locale会在preference.app.locale变更之后才会更新,因此watchpreference.app.locale是不合适的,刷新页面时可能语言配置尚未完全加载完成 +watch(i18n.global.locale, refresh, { flush: 'post' }); const slots: SetupContext['slots'] = useSlots(); const headerSlots = computed(() => { diff --git a/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue b/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue index e50814217..ec36fed2a 100644 --- a/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue +++ b/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue @@ -92,7 +92,7 @@ const [Form, formApi] = useTableForm({ }, showCollapseButton: true, submitButtonOptions: { - content: $t('common.query'), + content: computed(() => $t('common.search')), }, wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3', });