Any idea how to implement editor.js with alpinejs? #785
adrian-ub
started this conversation in
4. General
Replies: 2 comments
-
Hi ! I am facing the same problem. Here is how I decided to implement this functionality: 1 - We move all work with editor.js to a separate js file and create a plugin for alpine with directive registration inside. import EditorJS from '@editorjs/editorjs'
export default function Editor(Alpine) {
Alpine.directive('editor', (holder, { value, modifiers, expession }, { Alpine, effect, cleanup }) => {
new EditorJS({ holder })
})
} 2 - then simply use the code as follows <script defer src="path/to/editor-js-alpine-plugin.js"></script>
<div x-editor></div> I hope I've helped solve the problem |
Beta Was this translation helpful? Give feedback.
0 replies
-
What events does EditorJS emit? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://editorjs.io/
I am using Livewire with AlpineJs and this is the code that I have, the editor can already be seen, but I have not been able to obtain the data:
Beta Was this translation helpful? Give feedback.
All reactions