From b319f08bb6fcb77fcc3522a52baf09bb0e01ef2d Mon Sep 17 00:00:00 2001 From: sunmeng <1162067978@qq.com> Date: Thu, 7 Nov 2024 11:43:35 +0800 Subject: [PATCH] 1 --- src/App.vue | 20 +++++++++++--------- src/views/videoLive.vue | 1 - 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/App.vue b/src/App.vue index 6afcd81..99ceefc 100644 --- a/src/App.vue +++ b/src/App.vue @@ -10,6 +10,16 @@ isMobile:false } }, + watch:{ +"$route"(newName, oldName) { + var routerNow = this.$route.name; + if(routerNow=='videoLive'){ + this.isMobile=true + }else{ + this.isMobile=false + } + }, + }, created(){ if (sessionStorage.getItem("store") ) { //在页面加载时读取sessionStorage里的状态信息 this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("store")))) @@ -17,15 +27,7 @@ window.addEventListener("beforeunload",()=>{ //在页面刷新时将vuex里的信息保存到sessionStorage里 sessionStorage.setItem("store",JSON.stringify(this.$store.state)) }) - if ( - navigator.userAgent.match( - /(iPhone|iPod|Android|ios|iOS|iPad|Backerry|WebOS|Symbian|Windows Phone|Phone)/i - ) - ) { - this.isMobile=true - } else { - this.isMobile=false - } + }, mounted(){ let inputList = document.querySelectorAll('input'); diff --git a/src/views/videoLive.vue b/src/views/videoLive.vue index b2f814c..d6803bd 100644 --- a/src/views/videoLive.vue +++ b/src/views/videoLive.vue @@ -240,7 +240,6 @@ export default { } } -