7
7
</template >
8
8
9
9
<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'
12
12
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
40
17
}
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
+ })
41
39
}
40
+ }
42
41
</script >
43
42
<style >
44
43
#app {
45
44
height : 100% ;
46
45
}
47
- </style >
46
+ </style >
0 commit comments