2222 >
2323 </el-switch >
2424 </el-col >
25- <el-col :span =" 3"
26- > {{ currentLocal["expand"] }}
25+ <el-col :span =" 3" >
26+ {{ currentLocal["expand"] }}
2727 <el-switch
2828 v-model =" enableExpand"
2929 :active-color =" switchActiveColor"
3030 :inactive-color =" switchInactiveColor"
3131 @change =" switchLoading"
3232 >
33- </el-switch
34- ></el-col >
35- <el-col :span =" 3" ><div ></div ></el-col >
36- <el-col :span =" 3" ><div ></div ></el-col >
33+ </el-switch >
34+ </el-col >
35+ <el-col :span =" 3" >
36+ {{ currentLocal["radio"] }}
37+ <el-switch
38+ v-model =" enableRowRadio"
39+ :active-color =" switchActiveColor"
40+ :inactive-color =" switchInactiveColor"
41+ @change =" switchLoading"
42+ >
43+ </el-switch >
44+ </el-col >
45+ <el-col :span =" 3" >
46+ {{ currentLocal["checkbox"] }}
47+ <el-switch
48+ v-model =" enableRowCheckbox"
49+ :active-color =" switchActiveColor"
50+ :inactive-color =" switchInactiveColor"
51+ @change =" switchLoading"
52+ >
53+ </el-switch >
54+ </el-col >
3755 <el-col :span =" 3" ><div ></div ></el-col >
3856 <el-col :span =" 3" ><div ></div ></el-col >
3957 <el-col :span =" 3" ><div ></div ></el-col >
5270 row-key-field-name =" rowKey"
5371 :cell-style-option =" cellStyleOption"
5472 :expand-option =" expandOption"
73+ :radio-option =" radioOption"
74+ :checkbox-optipon =" checkboxOptipon"
5575 />
5676 </div >
5777 <!-- <Footer /> -->
@@ -76,6 +96,8 @@ export default {
7696 enableColumnFixed: true ,
7797 enableLoading: false ,
7898 enableExpand: true ,
99+ enableRowRadio: false ,
100+ enableRowCheckbox: false ,
79101
80102 // ---------------table options---------------
81103 tableData: [],
@@ -90,6 +112,21 @@ export default {
90112 // 是否开启
91113 enable: true
92114 },
115+ radioOption: {
116+ selectedRowChange : ({ row }) => {
117+ console .log (row);
118+ }
119+ },
120+ checkboxOptipon: {
121+ // row select change event
122+ selectedRowChange : ({ row, isSelected, selectedRowKeys }) => {
123+ console .log (row, isSelected, selectedRowKeys);
124+ },
125+ // selected all change event
126+ selectedAllChange : ({ isSelected, selectedRowKeys }) => {
127+ console .log (isSelected, selectedRowKeys);
128+ }
129+ },
93130 expandOption: {
94131 render : ({ row, column, rowIndex }, h ) => {
95132 return (
@@ -113,6 +150,28 @@ export default {
113150 columns () {
114151 let columns = [];
115152
153+ if (this .enableRowRadio ) {
154+ columns .push ({
155+ field: " radio" ,
156+ key: " radio" ,
157+ title: " " ,
158+ width: 30 ,
159+ fixed: this .enableColumnFixed ? " left" : " " ,
160+ type: " radio"
161+ });
162+ }
163+
164+ if (this .enableRowCheckbox ) {
165+ columns .push ({
166+ field: " checkbox" ,
167+ key: " checkbox" ,
168+ title: " " ,
169+ width: 30 ,
170+ fixed: this .enableColumnFixed ? " left" : " " ,
171+ type: " checkbox"
172+ });
173+ }
174+
116175 if (this .enableExpand ) {
117176 columns .push ({
118177 field: " expand" ,
0 commit comments