|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="app-main">
|
|
|
+ <div class="app-main" @click="handClick">
|
|
|
<router-view v-slot="{ Component, route }">
|
|
|
<Transition :enter-active-class="proxy?.animate.page.enter">
|
|
|
<component :is="Component" :key="route.path" />
|
|
@@ -10,6 +10,37 @@
|
|
|
|
|
|
<script setup name="AppMain" lang="ts">
|
|
|
const { proxy } = getCurrentInstance() as any;
|
|
|
+const router = useRouter();
|
|
|
+
|
|
|
+const data = reactive<any>({
|
|
|
+ timer: null,
|
|
|
+
|
|
|
+});
|
|
|
+const { timer } = toRefs(data);
|
|
|
+
|
|
|
+
|
|
|
+const handClick = () => {
|
|
|
+ getClearTimer()
|
|
|
+ getCountDown();
|
|
|
+};
|
|
|
+
|
|
|
+const getCountDown = () => {
|
|
|
+ timer.value = setTimeout(() => {
|
|
|
+ router.push({ path: '/ranking' });
|
|
|
+ }, 1000 * 60 * 15)
|
|
|
+};
|
|
|
+
|
|
|
+const getClearTimer = () => {
|
|
|
+ clearTimeout(timer.value)
|
|
|
+};
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getCountDown()
|
|
|
+})
|
|
|
+
|
|
|
+onUnmounted(() => {
|
|
|
+ getClearTimer()
|
|
|
+})
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.app-main {
|