Skip to content

Commit

Permalink
fix: error when switching to multiple languages
Browse files Browse the repository at this point in the history
  • Loading branch information
tolking committed Dec 2, 2024
1 parent e679055 commit fae2f95
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Crud/useCrud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ type CrudColumns =
export function useCrudMenu(
props: Readonly<{ menu?: ICrudMenuColumns | boolean }>,
): Ref<ICrudMenuColumns> {
const { t } = useLocale()

return computed(() => {
const { t } = useLocale()
const menu: ICrudMenuColumns = {
...formMenu,
add: true,
Expand Down
3 changes: 2 additions & 1 deletion src/Form/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ export const formMenu: IFormMenuColumns = {
export function useFormMenu(
props: Pick<IFormProps, 'menu'>,
): ComputedRef<IFormMenuColumns> {
const { t } = useLocale()

return computed(() => {
const menu = { ...formMenu }
const { t } = useLocale()
const submitText = t('pro.form.submit')
const resetText = t('pro.form.reset')
const prevText = t('pro.form.prev')
Expand Down
3 changes: 2 additions & 1 deletion src/Serach/useSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ export const searchMenu: IFormMenuColumns = {
export function useSearchMenu(
props: Pick<ISearchProps, 'menu'>,
): ComputedRef<IFormMenuColumns> {
const { t } = useLocale()

return computed(() => {
const menu = { ...searchMenu }
const { t } = useLocale()
const submitText = t('pro.search.submit')
const resetText = t('pro.search.reset')
const prevText = t('pro.search.prev')
Expand Down

0 comments on commit fae2f95

Please sign in to comment.