fix(学生端): 修复收藏试卷后排序不更新的问题

添加favoriteVersion变量作为依赖触发sortedTableData重新计算,确保收藏状态变化后列表能正确排序
This commit is contained in:
CGW406
2026-04-25 10:05:20 +08:00
parent 64beb23458
commit a2bd0e2078
@@ -54,7 +54,8 @@ export default {
listLoading: true,
subjectList: [],
tableData: [],
total: 0
total: 0,
favoriteVersion: 0
}
},
computed: {
@@ -62,6 +63,7 @@ export default {
paperTypeEnum: state => state.exam.examPaper.paperTypeEnum
}),
sortedTableData () {
this.favoriteVersion
return sortByFavorite(this.tableData)
}
},
@@ -105,6 +107,7 @@ export default {
subjectId: row.subjectId
})
if (result) {
this.favoriteVersion++
this.$message({
message: this.isPaperFavorite(row.id) ? '收藏成功' : '已取消收藏',
type: 'success',