2019-03-18 16:35:13 +00:00
|
|
|
<template>
|
2019-03-20 12:22:52 +00:00
|
|
|
<a-locale-provider :locale="locale">
|
2020-07-13 01:32:07 +00:00
|
|
|
<div id="app" class="h-full">
|
2019-04-24 03:14:44 +00:00
|
|
|
<router-view />
|
2019-03-20 12:22:52 +00:00
|
|
|
</div>
|
|
|
|
</a-locale-provider>
|
2019-03-18 16:35:13 +00:00
|
|
|
</template>
|
|
|
|
|
2019-03-20 12:22:52 +00:00
|
|
|
<script>
|
|
|
|
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
|
|
|
|
import { deviceEnquire, DEVICE_TYPE } from '@/utils/device'
|
|
|
|
|
|
|
|
export default {
|
2019-03-22 01:57:06 +00:00
|
|
|
data() {
|
2019-03-20 12:22:52 +00:00
|
|
|
return {
|
|
|
|
locale: zhCN
|
2019-03-18 16:35:13 +00:00
|
|
|
}
|
2019-03-20 12:22:52 +00:00
|
|
|
},
|
2019-03-22 01:57:06 +00:00
|
|
|
mounted() {
|
2019-03-20 12:22:52 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
})
|
2019-03-18 16:35:13 +00:00
|
|
|
}
|
|
|
|
}
|
2019-03-20 12:22:52 +00:00
|
|
|
</script>
|