大屏切换

This commit is contained in:
2022-07-29 18:41:53 +08:00
parent 5c4ae75808
commit 780ef33067
4 changed files with 64 additions and 7 deletions

41
src/pages/HomeScreen.vue Normal file
View File

@@ -0,0 +1,41 @@
<template>
<section class="box">
<Monitoring-Screen v-if="page === 'two'"></Monitoring-Screen>
<Device-Screen v-if="page === 'one'"></Device-Screen>
</section>
</template>
<script>
import MonitoringScreen from './MonitoringScreen.vue'
import DeviceScreen from './DeviceScreen.vue'
export default {
name: 'HomeScreen',
components: {
MonitoringScreen,
DeviceScreen
},
data () {
return {
page: 'one',
timer: null
}
},
mounted () {
this.swipePage()
},
methods: {
swipePage () {
this.timer = setInterval(() => {
this.page = this.page === 'one' ? 'two' : 'one'
}, 5000)
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@css/mixin'
.box
_wh(100%, 100%)
overflow hidden
</style>