diff options
Diffstat (limited to 'apps/files/src/components/CustomElementRender.vue')
-rw-r--r-- | apps/files/src/components/CustomElementRender.vue | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/apps/files/src/components/CustomElementRender.vue b/apps/files/src/components/CustomElementRender.vue index b5dc510b645..bb6df3fd854 100644 --- a/apps/files/src/components/CustomElementRender.vue +++ b/apps/files/src/components/CustomElementRender.vue @@ -20,20 +20,40 @@ - --> <template> - <div /> + <span /> </template> <script> export default { name: 'CustomElementRender', props: { - element: { - type: HTMLElement, + source: { + type: Object, required: true, }, + currentView: { + type: Object, + required: true, + }, + render: { + type: Function, + required: true, + }, + }, + computed: { + element() { + return this.render(this.source, this.currentView) + }, + }, + watch: { + element() { + this.$el.replaceWith(this.element) + this.$el = this.element + }, }, mounted() { this.$el.replaceWith(this.element) + this.$el = this.element }, } </script> |