fix(frontend): 修复DataTable无限循环和i18n邮箱解析错误
- 修复DataTable组件watch监听actionsExpanded导致的无限循环卡死问题 - 为AccountsView和UsersView添加actionsCount属性启用操作列展开功能 - 修复i18n翻译中邮箱地址的@符号未转义导致的编译错误
This commit is contained in:
@@ -257,9 +257,10 @@ const sortKey = ref<string>('')
|
||||
const sortOrder = ref<'asc' | 'desc'>('asc')
|
||||
const actionsExpanded = ref(false)
|
||||
|
||||
// 数据/列/展开状态变化时重新检查滚动状态
|
||||
// 数据/列变化时重新检查滚动状态
|
||||
// 注意:不能监听 actionsExpanded,因为 checkActionsColumnWidth 会临时修改它,会导致无限循环
|
||||
watch(
|
||||
[() => props.data.length, () => props.columns, actionsExpanded],
|
||||
[() => props.data.length, () => props.columns],
|
||||
async () => {
|
||||
await nextTick()
|
||||
checkScrollable()
|
||||
@@ -268,6 +269,12 @@ watch(
|
||||
{ flush: 'post' }
|
||||
)
|
||||
|
||||
// 单独监听展开状态变化,只更新滚动状态
|
||||
watch(actionsExpanded, async () => {
|
||||
await nextTick()
|
||||
checkScrollable()
|
||||
})
|
||||
|
||||
const handleSort = (key: string) => {
|
||||
if (sortKey.value === key) {
|
||||
sortOrder.value = sortOrder.value === 'asc' ? 'desc' : 'asc'
|
||||
|
||||
Reference in New Issue
Block a user