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>
|
Loading…
Add table
Add a link
Reference in a new issue