From af5e3bec76288f650fa68b9a01bf6501d9890cf9 Mon Sep 17 00:00:00 2001 From: Ilya Date: Mon, 7 Oct 2019 01:40:49 +0300 Subject: [PATCH] fix(history): fix error if no options for the extension --- demo/config.js | 2 +- demo/pages/Index.vue | 5 +---- src/extensions/nativeExtensions/History.ts | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/demo/config.js b/demo/config.js index 2dc40ac..ba3f65d 100644 --- a/demo/config.js +++ b/demo/config.js @@ -1,2 +1,2 @@ -export const MAIN_MODULE = import('../dist/bundle-cjs') // '../dist/bundle-cjs' +export const MAIN_MODULE = import('../src/main') // '../dist/bundle-cjs' // export const MAIN_MODULE = import('../dist/bundle-esm') // '../dist/bundle-cjs' diff --git a/demo/pages/Index.vue b/demo/pages/Index.vue index e26438d..b01b4f2 100644 --- a/demo/pages/Index.vue +++ b/demo/pages/Index.vue @@ -44,10 +44,7 @@ export default { CodeBlock, HorizontalRule, Paragraph, - [History, { - // если не нужны кнокпи - options: { noActions: true } - }], + History, HardBreak, // позволяет переносить через Shift + Ctrl + Enter Underline, Strike, diff --git a/src/extensions/nativeExtensions/History.ts b/src/extensions/nativeExtensions/History.ts index 93fc321..889d2c6 100644 --- a/src/extensions/nativeExtensions/History.ts +++ b/src/extensions/nativeExtensions/History.ts @@ -13,7 +13,7 @@ export default class History extends AbstractExtension { get availableActions (): ExtensionActionInterface[] { // если не нужны кнокпи - if (this.options.noActions) return [] + if (this.options && this.options.noActions) return [] return [ {