|
@@ -145,13 +145,22 @@ export default defineComponent({
|
|
|
: true;
|
|
|
});
|
|
|
|
|
|
+ const pageStatus = () => {
|
|
|
+ console.log(document.visibilityState, '');
|
|
|
+ if (document.visibilityState === 'visible') {
|
|
|
+ console.log('页面可见');
|
|
|
+ }
|
|
|
+ };
|
|
|
onMounted(() => {
|
|
|
getDetail();
|
|
|
getList();
|
|
|
listenerMessage('downloadCoursewareToCache', getProgress);
|
|
|
+
|
|
|
+ window.addEventListener('visibilitychange', pageStatus);
|
|
|
});
|
|
|
onUnmounted(() => {
|
|
|
removeListenerMessage('downloadCoursewareToCache', getProgress);
|
|
|
+ window.removeEventListener('visibilitychange', pageStatus);
|
|
|
});
|
|
|
|
|
|
const handleClick = async (item: any) => {
|