xianniu-ui 0.3.9 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/xianniu-ui.common.js +38 -54
- package/lib/xianniu-ui.umd.js +38 -54
- package/lib/xianniu-ui.umd.min.js +2 -2
- package/package.json +1 -1
- package/packages/table/main.vue +14 -4
package/package.json
CHANGED
package/packages/table/main.vue
CHANGED
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
:stripe="stripe"
|
|
98
98
|
@row-click="singleElection"
|
|
99
99
|
@selection-change="selectionChange"
|
|
100
|
+
:row-class-name="tableRowClassName"
|
|
100
101
|
:class="{ 'disabled-all-selection': radio }"
|
|
101
102
|
>
|
|
102
103
|
<el-table-column
|
|
@@ -108,7 +109,11 @@
|
|
|
108
109
|
></el-table-column>
|
|
109
110
|
<el-table-column v-bind="$attrs" v-if="radio" width="40px" align="center">
|
|
110
111
|
<template slot-scope="{ row }">
|
|
111
|
-
<el-radio
|
|
112
|
+
<el-radio
|
|
113
|
+
v-model="radioSelected"
|
|
114
|
+
:label="row[idKey]"
|
|
115
|
+
> </el-radio
|
|
116
|
+
>
|
|
112
117
|
</template>
|
|
113
118
|
</el-table-column>
|
|
114
119
|
<el-table-column
|
|
@@ -196,12 +201,14 @@ export default {
|
|
|
196
201
|
getList(val) {
|
|
197
202
|
this.$emit("on-page", val);
|
|
198
203
|
},
|
|
199
|
-
singleElection(val) {
|
|
204
|
+
singleElection(val, column) {
|
|
200
205
|
if (!this.radio) return;
|
|
201
206
|
const { idKey } = this;
|
|
202
207
|
this.radioSelected = val[idKey];
|
|
203
|
-
const res = this.data.
|
|
204
|
-
|
|
208
|
+
const res = this.data.find(
|
|
209
|
+
(item, idx) => item[idKey] === val[idKey] && idx === val.rowIndex
|
|
210
|
+
);
|
|
211
|
+
this.$emit("on-single", res, column);
|
|
205
212
|
},
|
|
206
213
|
handleToolsItem(row, index) {
|
|
207
214
|
this.$emit("on-tools", { row, index });
|
|
@@ -228,6 +235,9 @@ export default {
|
|
|
228
235
|
doLayout() {
|
|
229
236
|
this.$refs.table.doLayout();
|
|
230
237
|
},
|
|
238
|
+
tableRowClassName({ row, rowIndex }) {
|
|
239
|
+
row.rowIndex = rowIndex;
|
|
240
|
+
},
|
|
231
241
|
},
|
|
232
242
|
};
|
|
233
243
|
</script>
|