diff options
author | Ferdinand Thiessen <rpm@fthiessen.de> | 2022-06-29 21:06:43 +0300 |
---|---|---|
committer | Jonas <jonas@freesources.org> | 2022-07-04 10:43:05 +0300 |
commit | d26ed3222cfe338d111a3d4b673c2043930c05d5 (patch) | |
tree | 38a5e3603389b5084c8749ef8df67d3b5afef408 /src/components/BaseReader.vue | |
parent | 014f73fced8c39475f5cc1be9fdcef75e23a5172 (diff) |
BaseReader: Use a factory pattern for creating the extension list
Provide functions are neither called on the providing object nor
on the injecting object, so using `this` within provided functions
will refer to the global `this` for which `$emit` is not defined.
This uses a factory pattern so that `this` is bound to the injecting
object.
Also forwarding the `click-link` event is needed.
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
Diffstat (limited to 'src/components/BaseReader.vue')
-rw-r--r-- | src/components/BaseReader.vue | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/components/BaseReader.vue b/src/components/BaseReader.vue index 1f48b1f60..6b0e81a74 100644 --- a/src/components/BaseReader.vue +++ b/src/components/BaseReader.vue @@ -31,6 +31,7 @@ import { EditorContent } from '@tiptap/vue-2' export default { name: 'BaseReader', components: { EditorContent }, + // extensions is a factory building a list of extensions for the editor inject: ['renderHtml', 'extensions'], props: { @@ -65,7 +66,7 @@ export default { createEditor() { return new Editor({ content: this.htmlContent, - extensions: this.extensions, + extensions: this.extensions(), }) }, |