Unverified Commit 5cb512cb by Sendya

fix: #51 sidebar collapsed padding

parent 3f480dc3
<template> <template>
<a-locale-provider :locale="locale"> <a-locale-provider :locale="locale">
<div id="app"> <div id="app">
<router-view/> <router-view/>
</div> </div>
</a-locale-provider> </a-locale-provider>
</template> </template>
<script> <script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN' import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import { deviceEnquire, DEVICE_TYPE } from '@/utils/device' import { deviceEnquire, DEVICE_TYPE } from '@/utils/device'
import { version } from 'ant-design-vue'
export default {
export default { data () {
data () { return {
return { locale: zhCN
locale: zhCN, }
version },
} mounted () {
}, const { $store } = this
mounted () { deviceEnquire(deviceType => {
const { $store } = this
console.log('use Ant-Design Of Vue:', version) switch (deviceType) {
deviceEnquire(deviceType => { case DEVICE_TYPE.DESKTOP:
$store.commit('TOGGLE_DEVICE', 'desktop')
switch (deviceType) { $store.dispatch('setSidebar', true)
case DEVICE_TYPE.DESKTOP: break
$store.commit('TOGGLE_DEVICE', 'desktop') case DEVICE_TYPE.TABLET:
$store.dispatch('setSidebar', true) $store.commit('TOGGLE_DEVICE', 'tablet')
break $store.dispatch('setSidebar', false)
case DEVICE_TYPE.TABLET: break
console.log('tablet') case DEVICE_TYPE.MOBILE:
$store.dispatch('ToggleDevice', 'tablet') default:
$store.dispatch('setSidebar', false) $store.commit('TOGGLE_DEVICE', 'mobile')
break $store.dispatch('setSidebar', true)
case DEVICE_TYPE.MOBILE: break
default: }
$store.commit('TOGGLE_DEVICE', 'mobile') console.log('deviceType', deviceType)
$store.dispatch('setSidebar', false) })
break }
} }
console.log('deviceType', deviceType) </script>
}) <style>
} #app {
} height: 100%;
</script> }
<style>
#app {
height: 100%;
}
</style> </style>
\ No newline at end of file
...@@ -14,6 +14,7 @@ const mixin = { ...@@ -14,6 +14,7 @@ const mixin = {
colorWeak: state => state.app.weak, colorWeak: state => state.app.weak,
fixedHeader: state => state.app.fixedHeader, fixedHeader: state => state.app.fixedHeader,
fixSiderbar: state => state.app.fixSiderbar, fixSiderbar: state => state.app.fixSiderbar,
fixSidebar: state => state.app.fixSiderbar,
contentWidth: state => state.app.contentWidth, contentWidth: state => state.app.contentWidth,
autoHideHeader: state => state.app.autoHideHeader, autoHideHeader: state => state.app.autoHideHeader,
sidebarOpened: state => state.app.sidebar 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