Tabs support render head

This commit is contained in:
Aresn 2017-06-02 15:05:01 +08:00
parent eae3e936c8
commit 1f974700de
3 changed files with 43 additions and 4 deletions

View file

@ -0,0 +1,30 @@
<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>