44 <div class =" operation" >
55 <div class =" operation-item" >
66 <el-row :gutter =" 20" >
7+ <el-col :span =" 4" >
8+ {{ currentLocal["dataRows"] }}
9+ <el-select
10+ v-model =" dataRow"
11+ style =" width : 60% "
12+ size =" small"
13+ @change =" dataRowChange"
14+ >
15+ <el-option
16+ v-for =" item in currentLocal[
17+ 'dataRowsOption'
18+ ]"
19+ :key =" item.value"
20+ :label =" item.label"
21+ :value =" item.value"
22+ ></el-option >
23+ </el-select >
24+ </el-col >
725 <el-col :span =" 3" >
8- {{ currentLocal["theme "] }}
26+ {{ currentLocal["columnFixed "] }}
927 <el-switch
10- v-model =" enableDarkTheme "
28+ v-model =" enableColumnFixed "
1129 :active-color =" switchActiveColor"
1230 :inactive-color =" switchInactiveColor"
13- @change =" switchTheme"
1431 ></el-switch >
1532 </el-col >
16-
1733 <el-col :span =" 3" >
18- {{ currentLocal["columnFixed "] }}
34+ {{ currentLocal["expand "] }}
1935 <el-switch
20- v-model =" enableColumnFixed "
36+ v-model =" enableExpand "
2137 :active-color =" switchActiveColor"
2238 :inactive-color =" switchInactiveColor"
2339 ></el-switch >
3248 ></el-switch >
3349 </el-col >
3450 <el-col :span =" 3" >
35- {{ currentLocal["expand "] }}
51+ {{ currentLocal["radio "] }}
3652 <el-switch
37- v-model =" enableExpand "
53+ v-model =" enableRowRadio "
3854 :active-color =" switchActiveColor"
3955 :inactive-color =" switchInactiveColor"
4056 ></el-switch >
4157 </el-col >
4258 <el-col :span =" 3" >
43- {{ currentLocal["radio "] }}
59+ {{ currentLocal["checkbox "] }}
4460 <el-switch
45- v-model =" enableRowRadio "
61+ v-model =" enableRowCheckbox "
4662 :active-color =" switchActiveColor"
4763 :inactive-color =" switchInactiveColor"
4864 ></el-switch >
4965 </el-col >
5066 <el-col :span =" 3" >
51- {{ currentLocal["checkbox "] }}
67+ {{ currentLocal["theme "] }}
5268 <el-switch
53- v-model =" enableRowCheckbox "
69+ v-model =" enableDarkTheme "
5470 :active-color =" switchActiveColor"
5571 :inactive-color =" switchInactiveColor"
72+ @change =" switchTheme"
5673 ></el-switch >
5774 </el-col >
58- <el-col :span =" 3" ></el-col >
59- <el-col :span =" 3" ></el-col >
75+ <el-col :span =" 2" ></el-col >
6076 </el-row >
6177 </div >
6278 <!-- <div class="operation-item">
@@ -108,6 +124,7 @@ export default {
108124 mixins: [I18nMixins, ThemeSwitchMixins],
109125 data () {
110126 return {
127+ dataRow: 1000 ,
111128 switchActiveColor: " #1890ff" ,
112129 switchInactiveColor: " rgba(0,0,0,.25)" ,
113130
@@ -515,6 +532,15 @@ export default {
515532 this .filter ();
516533 },
517534
535+ // data row change
536+ dataRowChange () {
537+ setTimeout (() => {
538+ this .initSourceData ();
539+ // scroll to top
540+ this .$refs [" tableRef" ].scrollTo ({ top: 0 });
541+ });
542+ },
543+
518544 initSourceData () {
519545 const PROFESSIONS = [
520546 " Project Manager" ,
@@ -526,7 +552,9 @@ export default {
526552 ];
527553
528554 let data = [];
529- for (let i = 0 ; i < 10000 ; i++ ) {
555+
556+ const dataRow = this .dataRow ;
557+ for (let i = 0 ; i < dataRow; i++ ) {
530558 data .push ({
531559 rowKey: i,
532560 rowIndex: i + 1 ,
@@ -567,10 +595,11 @@ export default {
567595 padding : 10px ;
568596
569597 .operation {
570- margin : 30 px 0 ;
598+ margin : 10 px 0 ;
571599
572600 .operation-item {
573601 height : 50px ;
602+ line-height : 50px ;
574603 }
575604 }
576605
0 commit comments