From 73fab096b9834b83bee0115fcf119ab47be65fa0 Mon Sep 17 00:00:00 2001 From: Avris Date: Tue, 2 Feb 2021 21:56:17 +0100 Subject: [PATCH] spelling - fix handling empty tags --- components/Spelling.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/components/Spelling.vue b/components/Spelling.vue index 29f56b9a..1ca14454 100644 --- a/components/Spelling.vue +++ b/components/Spelling.vue @@ -7,7 +7,18 @@ text: {}, }, render(h) { - return h('span', {domProps: { innerHTML: this.handleSpelling(this.text !== undefined ? this.text : this.$slots.default[0].text) }}); + return h('span', {domProps: { innerHTML: this.handleSpelling(this.val) }}); }, + computed: { + val() { + if (this.text !== undefined) { + return this.text; + } + if (this.$slots.default && this.$slots.default.length) { + return this.$slots.default[0].text; + } + return '' + } + } }