File tree 4 files changed +13
-10
lines changed
4 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 8
8
import { defineComponent } from ' vue' ;
9
9
import { ElConfigProvider } from ' element-plus' ;
10
10
import zhCn from ' element-plus/dist/locale/zh-cn.mjs' ;
11
+ import { mapState } from ' pinia' ;
12
+ import store from ' @/store' ;
11
13
12
14
export default defineComponent ({
13
15
components: {
14
16
ElConfigProvider
15
17
},
18
+ computed: {
19
+ ... mapState (store .app , [' size' ])
20
+ },
16
21
data () {
17
22
return {
18
23
locale: zhCn,
19
- zIndex: 3000 ,
20
- size: ' default'
24
+ zIndex: 3000
21
25
};
22
26
}
23
27
});
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export default defineComponent({
24
24
sizeOptions: [
25
25
{ label: ' Default' , value: ' default' },
26
26
{ label: ' Large' , value: ' large' },
27
- { label: ' small ' , value: ' default ' }
27
+ { label: ' Small ' , value: ' small ' }
28
28
]
29
29
};
30
30
},
@@ -35,7 +35,6 @@ export default defineComponent({
35
35
},
36
36
methods: {
37
37
handleSetSize (size ) {
38
- this .$ELEMENT .size = size;
39
38
store .app ().setSize (size);
40
39
this .refreshView ();
41
40
ElMessage ({
Original file line number Diff line number Diff line change 13
13
14
14
<screenfull id =" screenfull" class =" right-menu-item hover-effect" />
15
15
16
- <!-- < el-tooltip content="Global Size" effect="dark" placement="bottom">
16
+ <el-tooltip content =" Global Size" effect =" dark" placement =" bottom" >
17
17
<size-select id =" size-select" class =" right-menu-item hover-effect" />
18
- </el-tooltip> -->
18
+ </el-tooltip >
19
19
20
20
</template >
21
21
@@ -57,7 +57,7 @@ import Breadcrumb from '@/components/Breadcrumb';
57
57
import Hamburger from ' @/components/Hamburger' ;
58
58
import ErrorLog from ' @/components/ErrorLog' ;
59
59
import Screenfull from ' @/components/Screenfull' ;
60
- // import SizeSelect from '@/components/SizeSelect';
60
+ import SizeSelect from ' @/components/SizeSelect' ;
61
61
import Search from ' @/components/HeaderSearch' ;
62
62
import { defineComponent } from ' vue' ;
63
63
import { CaretBottom } from ' @element-plus/icons-vue' ;
@@ -68,7 +68,7 @@ export default defineComponent({
68
68
Hamburger,
69
69
ErrorLog,
70
70
Screenfull,
71
- // SizeSelect,
71
+ SizeSelect,
72
72
Search,
73
73
CaretBottom
74
74
},
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ interface IAppState {
7
7
withoutAnimation : boolean ;
8
8
} ;
9
9
device : 'desktop' | 'mobile' ;
10
- size : string ;
10
+ size : 'large' | 'default' | 'small' ;
11
11
}
12
12
13
13
export default defineStore ( {
@@ -18,7 +18,7 @@ export default defineStore({
18
18
withoutAnimation : false
19
19
} ,
20
20
device : 'desktop' ,
21
- size : Cookies . get ( 'size' ) || 'medium '
21
+ size : Cookies . get ( 'size' ) || 'default '
22
22
} ) ,
23
23
getters : { } ,
24
24
actions : {
You can’t perform that action at this time.
0 commit comments