mirror of
https://github.com/mindskip/xzs-mysql.git
synced 2026-08-28 19:12:15 +08:00
fix(学生端): 修复收藏试卷后排序不更新的问题
添加favoriteVersion变量作为依赖触发sortedTableData重新计算,确保收藏状态变化后列表能正确排序
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user