update Tabs render
This commit is contained in:
parent
4098c176e1
commit
55dbf62d68
4 changed files with 11 additions and 32 deletions
10
src/components/base/render.js
Normal file
10
src/components/base/render.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
export default {
|
||||
name: 'RenderCell',
|
||||
functional: true,
|
||||
props: {
|
||||
render: Function
|
||||
},
|
||||
render: (h, ctx) => {
|
||||
return ctx.props.render(h);
|
||||
}
|
||||
};
|
|
@ -1,30 +0,0 @@
|
|||
<template>
|
||||
<div ref="cell"></div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
export default {
|
||||
name: 'RenderCell',
|
||||
props: {
|
||||
render: Function
|
||||
},
|
||||
methods: {
|
||||
compile () {
|
||||
if (this.render) {
|
||||
this.$el.innerHTML = '';
|
||||
const component = new Vue({
|
||||
functional: true,
|
||||
render: (h) => {
|
||||
return this.render(h);
|
||||
}
|
||||
});
|
||||
const Cell = component.$mount();
|
||||
this.$refs.cell.appendChild(Cell.$el);
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.compile();
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
export default {
|
||||
name: 'TableExpand',
|
||||
functional: true,
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
</template>
|
||||
<script>
|
||||
import Icon from '../icon/icon.vue';
|
||||
import Render from '../base/render.vue';
|
||||
import Render from '../base/render';
|
||||
import { oneOf, getStyle } from '../../utils/assist';
|
||||
import Emitter from '../../mixins/emitter';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue