问题描述:在自助机上操作上会出现一个问题,就是用户操作到一半或者操作完成了就走了,没有返回到首页。
功能介绍:vue监听当前页面是否处于操作状态,如果超过指定的时间都处于待机无操作状态,直接返回到指定页面。
template代码如下:
<template> <div id="app" @mousemove="moveEvent" @click="moveEvent"> <router-view v-if="isRefersh" /> </div> </template>
script代码如下:
export default { data() { return { countdown: 10 timmer: null }; }, methods: { /*监听鼠标滑动和点击事件*/ moveEvent() { //在规定的状态下执行方法 if (this.$route.query.flag && localStorage.getItem('dType')) { clearTimeout(this.timmer); this.init(); } }, init() { this.timmer = setTimeout(() => { window.location.href = '/index.html' }, 1000 * this.countdown); }, } }
上面是“vue监听当前页面是否处于操作状态,待机无操作状态返回指定页面”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_4540.html
workflows工作流
一只可爱的飞鸟ComfyUI工作流
一张科幻照片,火星车在沙漠里ComfyUI工作流
一尊白玉猴王ComfyUI工作流
红伞伞蓝杆杆云南蘑菇群ComfyUI工作流
1个黑发带着耳机项链的女孩ComfyUI工作流
一个纸杯蛋糕ComfyUI工作流
一个穿过泥泞雷区的士兵ComfyUI工作流
在森林中心有一座蛇形的房子ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!