Commit c5a50470 by Sendya

fix: #51 sidebar collapsed padding

parent cac3a58a
<template>
<a-locale-provider :locale="locale">
<div id="app">
<router-view/>
</div>
</a-locale-provider>
</template>
<script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import { deviceEnquire, DEVICE_TYPE } from '@/utils/device'
import { version } from 'ant-design-vue'
export default {
data () {
return {
locale: zhCN,
version
}
},
mounted () {
const { $store } = this
console.log('use Ant-Design Of Vue:', version)
deviceEnquire(deviceType => {
switch (deviceType) {
case DEVICE_TYPE.DESKTOP:
$store.commit('TOGGLE_DEVICE', 'desktop')
$store.dispatch('setSidebar', true)
break
case DEVICE_TYPE.TABLET:
console.log('tablet')
$store.dispatch('ToggleDevice', 'tablet')
$store.dispatch('setSidebar', false)
break
case DEVICE_TYPE.MOBILE:
default:
$store.commit('TOGGLE_DEVICE', 'mobile')
$store.dispatch('setSidebar', false)
break
}
console.log('deviceType', deviceType)
})
}
}
</script>
<style>
#app {
height: 100%;
}
<template>
<a-locale-provider :locale="locale">
<div id="app">
<router-view/>
</div>
</a-locale-provider>
</template>
<script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import { deviceEnquire, DEVICE_TYPE } 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
}
console.log('deviceType', deviceType)
})
}
}
</script>
<style>
#app {
height: 100%;
}
</style>
\ No newline at end of file
......@@ -14,6 +14,7 @@ const mixin = {
colorWeak: state => state.app.weak,
fixedHeader: state => state.app.fixedHeader,
fixSiderbar: state => state.app.fixSiderbar,
fixSidebar: state => state.app.fixSiderbar,
contentWidth: state => state.app.contentWidth,
autoHideHeader: state => state.app.autoHideHeader,
sidebarOpened: state => state.app.sidebar
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment