From bad0b1debb59c7fcf1a8b7e9eb76cb04db935c7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Mon, 10 Sep 2018 22:34:07 +0200 Subject: [PATCH] add destroy function --- packages/tiptap/src/components/editor.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/tiptap/src/components/editor.js b/packages/tiptap/src/components/editor.js index 4f54daeb..db2ce294 100644 --- a/packages/tiptap/src/components/editor.js +++ b/packages/tiptap/src/components/editor.js @@ -195,6 +195,12 @@ export default { }) }, + destroyEditor() { + if (this.view) { + this.view.destroy() + } + }, + updateMenuActions() { this.menuActions = buildMenuActions({ schema: this.schema, @@ -233,4 +239,8 @@ export default { this.initEditor() }, + beforeDestroy() { + this.destroyEditor() + }, + }