You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.1 KiB
50 lines
1.1 KiB
2 years ago
|
<template>
|
||
|
<a-config-provider :locale="locale">
|
||
|
<div id="app">
|
||
|
<router-view />
|
||
|
</div>
|
||
|
</a-config-provider>
|
||
|
</template>
|
||
|
<script>
|
||
|
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
|
||
|
import enquireScreen from '@/utils/device'
|
||
|
|
||
|
export default {
|
||
|
data() {
|
||
|
return {
|
||
|
locale: zhCN,
|
||
|
}
|
||
|
},
|
||
|
created() {
|
||
|
let that = this
|
||
|
enquireScreen((deviceType) => {
|
||
|
// tablet
|
||
|
if (deviceType === 0) {
|
||
|
that.$store.commit('TOGGLE_DEVICE', 'mobile')
|
||
|
that.$store.dispatch('setSidebar', false)
|
||
|
}
|
||
|
// mobile
|
||
|
else if (deviceType === 1) {
|
||
|
that.$store.commit('TOGGLE_DEVICE', 'mobile')
|
||
|
that.$store.dispatch('setSidebar', false)
|
||
|
} else {
|
||
|
that.$store.commit('TOGGLE_DEVICE', 'desktop')
|
||
|
that.$store.dispatch('setSidebar', true)
|
||
|
}
|
||
|
})
|
||
|
|
||
|
setTimeout(() => {
|
||
|
window.router = this.$router
|
||
|
// console.log(this.$router.getRoutes(), '当前router')
|
||
|
//console.log(this.$router.push('/src/views/course/SeCourseList'), '当前')
|
||
|
}, 0)
|
||
|
},
|
||
|
}
|
||
|
</script>
|
||
|
<style>
|
||
|
#app {
|
||
|
height: 100%;
|
||
|
}
|
||
|
</style>
|
||
|
|