aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/components/CustomElementRender.vue
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-03-24 16:27:47 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-04-06 14:49:31 +0200
commit0e764f753a3d47bba946dc3f64cef9536ac98d43 (patch)
treea2fa70c22ed666c920fa2575667298e24948cd2c /apps/files/src/components/CustomElementRender.vue
parent3c3050c76f86c7a8cc2f217f9305cb1051e0eca0 (diff)
downloadnextcloud-server-0e764f753a3d47bba946dc3f64cef9536ac98d43.tar.gz
nextcloud-server-0e764f753a3d47bba946dc3f64cef9536ac98d43.zip
fix(files): fix custom render components reactivity
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/src/components/CustomElementRender.vue')
-rw-r--r--apps/files/src/components/CustomElementRender.vue26
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>