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