I want to use editorjs build a article edit system, but can't find a vuejs or react example
You can write your own wrapper. There are also several examples written by a community:
https://github.com/changjoo-park/vue-editor-js
https://www.npmjs.com/package/vue-editor-js
Thank you. It helps a lot.
Recently a React wrapper was published by @stfy
https://github.com/stfy/react-editor.js
https://www.npmjs.com/package/@stfy/react-editor.js
it is so good
With Vue.js, if you don't want to use a third-party wrapper component, simply init the editor in the mounted() hook and assign it to window:
mounted() {
window.editor = new EditorJS({...})
}
You can now use that object to access editor.js methods:
data() {
return {
content: {}
}
},
methods: {
save() {
window.editor.save().then(saved => this.content = saved)
},
},
For your convenience we've collected an awesome-list with third-party libraries and extensions. You can find there wrappers for React and Vue
Most helpful comment
With Vue.js, if you don't want to use a third-party wrapper component, simply init the editor in the
mounted()hook and assign it towindow:You can now use that object to access editor.js methods: