<!--
|
* @Author: shuishen 1109946754@qq.com
|
* @Date: 2022-08-18 15:58:10
|
* @LastEditors: shuishen 1109946754@qq.com
|
* @LastEditTime: 2023-03-06 14:42:43
|
* @FilePath: \srs-police-affairs\src\App.vue
|
* @Description: app.vue
|
*
|
* Copyright (c) 2022 by shuishen 1109946754@qq.com, All Rights Reserved.
|
-->
|
<template>
|
<div id="app" :style="{
|
width: (useSceen == true ? currentWidth + 'px' : '100%'),
|
height: (useSceen == true ? currentHeight + 'px' : '100%')
|
}">
|
<router-view></router-view>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
data () {
|
return {
|
currentWidth: 0,
|
currentHeight: 0,
|
useSceen: false
|
}
|
},
|
|
watch: {
|
$route: {
|
handler (newPath, oldPath) {
|
if (newPath.path == "/layout/home") {
|
this.useSceen = true
|
} else {
|
this.useSceen = false
|
}
|
},
|
immediate: true
|
}
|
},
|
|
provide () {
|
return {
|
getWidth: this.getWidth
|
}
|
},
|
|
created () {
|
if (window.screen.availWidth) {
|
this.currentWidth = window.screen.width
|
this.currentHeight = window.screen.height
|
}
|
},
|
|
methods: {
|
getWidth () {
|
return this.currentWidth
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
#app {
|
width: 100%;
|
height: 100%;
|
font-family: Avenir, Helvetica, Arial, sans-serif;
|
-webkit-font-smoothing: antialiased;
|
-moz-osx-font-smoothing: grayscale;
|
text-align: center;
|
color: #2c3e50;
|
overflow: hidden;
|
}
|
</style>
|