Table support expand
This commit is contained in:
parent
df64fd36bd
commit
08fd628d1f
8 changed files with 339 additions and 38 deletions
37
src/components/table/expand.vue
Normal file
37
src/components/table/expand.vue
Normal file
|
@ -0,0 +1,37 @@
|
|||
<template>
|
||||
<div ref="cell"></div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
export default {
|
||||
name: 'TableExpand',
|
||||
props: {
|
||||
row: Object,
|
||||
render: Function,
|
||||
index: Number,
|
||||
},
|
||||
methods: {
|
||||
compile () {
|
||||
if (this.render) {
|
||||
this.$el.innerHTML = '';
|
||||
const component = new Vue({
|
||||
functional: true,
|
||||
render: (h) => {
|
||||
return this.render(h, {
|
||||
row: this.row,
|
||||
index: this.index
|
||||
});
|
||||
}
|
||||
});
|
||||
const Cell = component.$mount();
|
||||
this.$refs.cell.appendChild(Cell.$el);
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.$nextTick(() => {
|
||||
this.compile();
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue