update Tabs render

This commit is contained in:
Aresn 2017-06-09 16:54:20 +08:00
parent 4098c176e1
commit 55dbf62d68
4 changed files with 11 additions and 32 deletions

View file

@ -0,0 +1,10 @@
export default {
name: 'RenderCell',
functional: true,
props: {
render: Function
},
render: (h, ctx) => {
return ctx.props.render(h);
}
};

View file

@ -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>

View file

@ -1,4 +1,3 @@
export default {
name: 'TableExpand',
functional: true,

View file

@ -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';