mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-12-05 05:38:24 +08:00
Merge pull request #2473 from QingWei-Li/fix/table-column-key
Table: fix columnKey, fixed #2322
This commit is contained in:
commit
8453db88e5
@ -182,8 +182,7 @@ export default {
|
||||
created() {
|
||||
this.customRender = this.$options.render;
|
||||
this.$options.render = h => h('div', this.$slots.default);
|
||||
|
||||
let columnId = this.columnId = this.columnKey || ((this.$parent.tableId || (this.$parent.columnId + '_')) + 'column_' + columnIdSeed++);
|
||||
this.columnId = (this.$parent.tableId || (this.$parent.columnId + '_')) + 'column_' + columnIdSeed++;
|
||||
|
||||
let parent = this.$parent;
|
||||
let owner = this.owner;
|
||||
@ -210,7 +209,8 @@ export default {
|
||||
let isColumnGroup = false;
|
||||
|
||||
let column = getDefaultColumn(type, {
|
||||
id: columnId,
|
||||
id: this.columnId,
|
||||
columnKey: this.columnKey,
|
||||
label: this.label,
|
||||
className: this.className,
|
||||
property: this.prop || this.property,
|
||||
|
@ -152,15 +152,17 @@ TableStore.prototype.mutations = {
|
||||
}
|
||||
|
||||
const prop = column.property;
|
||||
const filters = [];
|
||||
|
||||
if (prop) {
|
||||
states.filters[column.id] = values;
|
||||
filters[column.columnKey || column.id] = values;
|
||||
}
|
||||
|
||||
let data = states._data;
|
||||
const filters = states.filters;
|
||||
|
||||
Object.keys(filters).forEach((columnId) => {
|
||||
const values = filters[columnId];
|
||||
Object.keys(states.filters).forEach((columnId) => {
|
||||
const values = states.filters[columnId];
|
||||
if (!values || values.length === 0) return;
|
||||
const column = getColumnById(this.states, columnId);
|
||||
if (column && column.filterMethod) {
|
||||
|
Loading…
Reference in New Issue
Block a user