task#15348,司机app自动刷新功能

This commit is contained in:
2024-10-11 20:47:49 +08:00
parent 36d2895f2b
commit b6a9836932
2 changed files with 16 additions and 9 deletions

View File

@ -75,10 +75,17 @@ export default {
}
},
mounted() {
console.log("mountedmounted")
const urlParams = new URLSearchParams(window.location.search);
this.supplierId = urlParams.get('supplierId');
this.getTrainingList();
document.addEventListener('visibilitychange', async ( ) => {
let state = document.visibilityState
if (state == 'hidden') { // 用户离开了
}
if (state == 'visible') {
this.getTrainingList();
}
});
},
methods:{
onRefresh() {