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>