pull/187/head
sunmeng 2024-11-07 11:43:35 +08:00
parent c131a98bab
commit b319f08bb6
2 changed files with 11 additions and 10 deletions

View File

@ -10,6 +10,16 @@
isMobile:false isMobile:false
} }
}, },
watch:{
"$route"(newName, oldName) {
var routerNow = this.$route.name;
if(routerNow=='videoLive'){
this.isMobile=true
}else{
this.isMobile=false
}
},
},
created(){ created(){
if (sessionStorage.getItem("store") ) { //sessionStorage if (sessionStorage.getItem("store") ) { //sessionStorage
this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("store")))) this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("store"))))
@ -17,15 +27,7 @@
window.addEventListener("beforeunload",()=>{ //vuexsessionStorage window.addEventListener("beforeunload",()=>{ //vuexsessionStorage
sessionStorage.setItem("store",JSON.stringify(this.$store.state)) 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(){ mounted(){
let inputList = document.querySelectorAll('input'); let inputList = document.querySelectorAll('input');

View File

@ -240,7 +240,6 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.videoLive { .videoLive {
width: 7.5rem; width: 7.5rem;