Table prop: content modify to context
Table prop: content modify to context
This commit is contained in:
parent
02ece5df26
commit
d8892603f7
2 changed files with 5 additions and 5 deletions
|
@ -31,7 +31,7 @@
|
|||
return {
|
||||
renderType: '',
|
||||
uid: -1,
|
||||
content: this.$parent.$parent.currentContent
|
||||
context: this.$parent.$parent.currentContext
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -48,7 +48,7 @@
|
|||
methods: {
|
||||
compile () {
|
||||
if (this.column.render) {
|
||||
const $parent = this.content;
|
||||
const $parent = this.context;
|
||||
const template = this.column.render(this.row, this.column, this.index);
|
||||
const cell = document.createElement('div');
|
||||
cell.innerHTML = template;
|
||||
|
|
|
@ -142,7 +142,7 @@
|
|||
return '';
|
||||
}
|
||||
},
|
||||
content: {
|
||||
context: {
|
||||
type: Object
|
||||
},
|
||||
noDataText: {
|
||||
|
@ -173,7 +173,7 @@
|
|||
bodyHeight: 0,
|
||||
bodyRealHeight: 0,
|
||||
scrollBarWidth: getScrollBarSize(),
|
||||
currentContent: this.content,
|
||||
currentContext: this.context,
|
||||
cloneData: deepCopy(this.data) // when Cell has a button to delete row data, clickCurrentRow will throw an error, so clone a data
|
||||
};
|
||||
},
|
||||
|
@ -644,7 +644,7 @@
|
|||
}
|
||||
},
|
||||
created () {
|
||||
if (!this.content) this.currentContent = this.$parent;
|
||||
if (!this.context) this.currentContext = this.$parent;
|
||||
this.showSlotHeader = this.$refs.title !== undefined;
|
||||
this.showSlotFooter = this.$refs.footer !== undefined;
|
||||
this.rebuildData = this.makeDataWithSortAndFilter();
|
||||
|
|
Loading…
Add table
Reference in a new issue