task#13769,答题完成返回页面执行自动刷新

This commit is contained in:
2024-05-21 11:04:54 +08:00
parent 77195c619f
commit ee1ecb1a55

View File

@ -88,7 +88,7 @@ export default {
},
created() {
this.getList();
// this.getList();
// 每次回答完问题之后返回需重新加结果
},
@ -100,6 +100,13 @@ export default {
this.isLoading = false;
}, 1000);
},
beforeRouteUpdate(to, from, next) {
// 在当前路由改变,但是该组件被复用时调用
// 举例来说,对于带有动态参数的路径 /foo/:id在 /foo/1 和 /foo/2 之间跳转的时候,
// 由于会渲染同样的 Foo 组件,因此组件实例会被复用。而这个钩子就会在这个情况下被调用。
this.getList();
next();
},
async getList(){
let res= await pageList({
pageNum:this.pageNum,