1 | import Vue from 'vue';
|
2 | import { render } from './render';
|
3 | const Component = Vue.extend({
|
4 | props: {
|
5 | container: {
|
6 | type: String,
|
7 | default: 'span'
|
8 | },
|
9 | plugins: {
|
10 | type: Array
|
11 | },
|
12 | options: {
|
13 | type: Object
|
14 | }
|
15 | },
|
16 | render (createElement) {
|
17 | if (this.$slots.default) {
|
18 | const source = this.$slots.default.reduce((acc, vnode)=>acc + vnode.text, '');
|
19 | return createElement(this.container, render(createElement, source, this.plugins, this.options));
|
20 | }
|
21 | return null;
|
22 | }
|
23 | });
|
24 | export default Component;
|