mirror of https://github.com/halo-dev/halo-admin
41 lines
947 B
Vue
41 lines
947 B
Vue
<template>
|
|
<a-config-provider :locale="locale">
|
|
<div id="app" class="h-full">
|
|
<router-view />
|
|
</div>
|
|
</a-config-provider>
|
|
</template>
|
|
|
|
<script>
|
|
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
|
|
import { DEVICE_TYPE, deviceEnquire } from '@/utils/device'
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
locale: zhCN
|
|
}
|
|
},
|
|
mounted() {
|
|
const { $store } = this
|
|
deviceEnquire(deviceType => {
|
|
switch (deviceType) {
|
|
case DEVICE_TYPE.DESKTOP:
|
|
$store.commit('TOGGLE_DEVICE', 'desktop')
|
|
$store.dispatch('setSidebar', true)
|
|
break
|
|
case DEVICE_TYPE.TABLET:
|
|
$store.commit('TOGGLE_DEVICE', 'tablet')
|
|
$store.dispatch('setSidebar', false)
|
|
break
|
|
case DEVICE_TYPE.MOBILE:
|
|
default:
|
|
$store.commit('TOGGLE_DEVICE', 'mobile')
|
|
$store.dispatch('setSidebar', true)
|
|
break
|
|
}
|
|
})
|
|
}
|
|
}
|
|
</script>
|