77</template >
88
99<script >
10- import zhCN from ' ant-design-vue/lib/locale-provider/zh_CN'
11- import { deviceEnquire , DEVICE_TYPE } from ' @/utils/device'
10+ import zhCN from ' ant-design-vue/lib/locale-provider/zh_CN'
11+ import { deviceEnquire , DEVICE_TYPE } from ' @/utils/device'
1212
13- export default {
14- data () {
15- return {
16- locale: zhCN
17- }
18- },
19- mounted () {
20- const { $store } = this
21- deviceEnquire (deviceType => {
22-
23- switch (deviceType) {
24- case DEVICE_TYPE .DESKTOP :
25- $store .commit (' TOGGLE_DEVICE' , ' desktop' )
26- $store .dispatch (' setSidebar' , true )
27- break
28- case DEVICE_TYPE .TABLET :
29- $store .commit (' TOGGLE_DEVICE' , ' tablet' )
30- $store .dispatch (' setSidebar' , false )
31- break
32- case DEVICE_TYPE .MOBILE :
33- default :
34- $store .commit (' TOGGLE_DEVICE' , ' mobile' )
35- $store .dispatch (' setSidebar' , true )
36- break
37- }
38- console .log (' deviceType' , deviceType)
39- })
13+ export default {
14+ data () {
15+ return {
16+ locale: zhCN
4017 }
18+ },
19+ mounted () {
20+ const { $store } = this
21+ deviceEnquire (deviceType => {
22+ switch (deviceType) {
23+ case DEVICE_TYPE .DESKTOP :
24+ $store .commit (' TOGGLE_DEVICE' , ' desktop' )
25+ $store .dispatch (' setSidebar' , true )
26+ break
27+ case DEVICE_TYPE .TABLET :
28+ $store .commit (' TOGGLE_DEVICE' , ' tablet' )
29+ $store .dispatch (' setSidebar' , false )
30+ break
31+ case DEVICE_TYPE .MOBILE :
32+ default :
33+ $store .commit (' TOGGLE_DEVICE' , ' mobile' )
34+ $store .dispatch (' setSidebar' , true )
35+ break
36+ }
37+ console .log (' deviceType' , deviceType)
38+ })
4139 }
40+ }
4241 </script >
4342<style >
4443 #app {
4544 height : 100% ;
4645 }
47- </style >
46+ </style >
0 commit comments