We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vben Admin V5
在切换国际化语言时,vxe-table的column title 未跟随变化,只有在强制刷新时才会变化。
no output
No response
The text was updated successfully, but these errors were encountered:
测试没有重现。请说明可以稳定重现的具体操作步骤
Sorry, something went wrong.
我重新试了下,当 columns 定义在外部文件,例如 vxe-table 在index.vue, 而columns在data.ts中,会出现这个问题。查了下,估计是 $t 方法的调用时机的原因。我用 computed 包裹 columns 后问题得已解决,如下所示:
export const useColumns = () => computed((): VxeGridProps['columns'] => [ { type: 'checkbox', width: 60 }, { field: 'username', title: $t('ui.column.username'), minWidth: 80, }, { field: 'nickName', title: $t('ui.column.nickName'), minWidth: 130, }, ... ]
No branches or pull requests
Version
Vben Admin V5
Describe the bug?
在切换国际化语言时,vxe-table的column title 未跟随变化,只有在强制刷新时才会变化。
Reproduction
import { $t } from '@vben/locales';
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
field: 'username',
title: $t('ui.column.username'),
minWidth: 80,
},
{
field: 'nickName',
title: $t('ui.column.nickName'),
minWidth: 130,
},
...
]
System Info
Relevant log output
No response
Validations
The text was updated successfully, but these errors were encountered: