File tree Expand file tree Collapse file tree 4 files changed +13
-10
lines changed
Expand file tree Collapse file tree 4 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 88import { defineComponent } from ' vue' ;
99import { ElConfigProvider } from ' element-plus' ;
1010import zhCn from ' element-plus/dist/locale/zh-cn.mjs' ;
11+ import { mapState } from ' pinia' ;
12+ import store from ' @/store' ;
1113
1214export default defineComponent ({
1315 components: {
1416 ElConfigProvider
1517 },
18+ computed: {
19+ ... mapState (store .app , [' size' ])
20+ },
1621 data () {
1722 return {
1823 locale: zhCn,
19- zIndex: 3000 ,
20- size: ' default'
24+ zIndex: 3000
2125 };
2226 }
2327});
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export default defineComponent({
2424 sizeOptions: [
2525 { label: ' Default' , value: ' default' },
2626 { label: ' Large' , value: ' large' },
27- { label: ' small ' , value: ' default ' }
27+ { label: ' Small ' , value: ' small ' }
2828 ]
2929 };
3030 },
@@ -35,7 +35,6 @@ export default defineComponent({
3535 },
3636 methods: {
3737 handleSetSize (size ) {
38- this .$ELEMENT .size = size;
3938 store .app ().setSize (size);
4039 this .refreshView ();
4140 ElMessage ({
Original file line number Diff line number Diff line change 1313
1414 <screenfull id =" screenfull" class =" right-menu-item hover-effect" />
1515
16- <!-- < el-tooltip content="Global Size" effect="dark" placement="bottom">
16+ <el-tooltip content =" Global Size" effect =" dark" placement =" bottom" >
1717 <size-select id =" size-select" class =" right-menu-item hover-effect" />
18- </el-tooltip> -->
18+ </el-tooltip >
1919
2020 </template >
2121
@@ -57,7 +57,7 @@ import Breadcrumb from '@/components/Breadcrumb';
5757import Hamburger from ' @/components/Hamburger' ;
5858import ErrorLog from ' @/components/ErrorLog' ;
5959import Screenfull from ' @/components/Screenfull' ;
60- // import SizeSelect from '@/components/SizeSelect';
60+ import SizeSelect from ' @/components/SizeSelect' ;
6161import Search from ' @/components/HeaderSearch' ;
6262import { defineComponent } from ' vue' ;
6363import { CaretBottom } from ' @element-plus/icons-vue' ;
@@ -68,7 +68,7 @@ export default defineComponent({
6868 Hamburger,
6969 ErrorLog,
7070 Screenfull,
71- // SizeSelect,
71+ SizeSelect,
7272 Search,
7373 CaretBottom
7474 },
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ interface IAppState {
77 withoutAnimation : boolean ;
88 } ;
99 device : 'desktop' | 'mobile' ;
10- size : string ;
10+ size : 'large' | 'default' | 'small' ;
1111}
1212
1313export default defineStore ( {
@@ -18,7 +18,7 @@ export default defineStore({
1818 withoutAnimation : false
1919 } ,
2020 device : 'desktop' ,
21- size : Cookies . get ( 'size' ) || 'medium '
21+ size : Cookies . get ( 'size' ) || 'default '
2222 } ) ,
2323 getters : { } ,
2424 actions : {
You can’t perform that action at this time.
0 commit comments