max-length + options for RTE
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
import { debounce as _debounce } from 'underscore';
|
||||
import { Editor, EditorContent, EditorMenuBubble } from 'tiptap';
|
||||
import EditorMenuBar from './rte.menubar.js';
|
||||
import { MaxSize } from 'zero/config/rte.extensions.js';
|
||||
import { Placeholder } from 'tiptap-extensions';
|
||||
import createConfig from 'zero/config/rte.config.js';
|
||||
|
||||
@@ -58,6 +59,10 @@
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
maxLength: {
|
||||
type: Number,
|
||||
default: null
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: null
|
||||
@@ -139,6 +144,11 @@
|
||||
}));
|
||||
}
|
||||
|
||||
if (this.maxLength > 0)
|
||||
{
|
||||
this.extensions.push(new MaxSize({ maxSize: this.maxLength }));
|
||||
}
|
||||
|
||||
this.editor = new Editor({
|
||||
editable: !this.disabled,
|
||||
extensions: this.extensions,
|
||||
|
||||
Reference in New Issue
Block a user