资料:https://segmentfault.com/q/1010000009701743
找这个用户的回答
<template>
<div id="app" @click="isTimeOut">
<div id="main">
<router-view ></router-view>
</div>
</div>
</template>
data() {
return {
lastTime: null, // 最后一次点击的时间
currentTime: null, // 当前点击的时间
timeOut: 1 * 60 * 60 * 1000, // 设置超时时间:60分钟
};
},
created() {
this.lastTime = new Date().getTime();
},
methods: {
isTimeOut() {
this.currentTime = new Date().getTime(); // 记录这次点击的时间
if (thi