How to use editor.js in nuxt.js, are there any related examples?
Related #1036
Hi @Yakumo-Yukari! Try this.
<template>
<div id="codex-editor"></div>
</template>
<script>
let EditorJS = null;
if (process.client) {
EditorJS = require('@editorjs/editorjs')
}
export default {
mounted() {
const editor = new EditorJS({
/**
* Id of Element that should contain Editor instance
*/
holder: 'codex-editor'
});
}
}
</script>
Hi @Yakumo-Yukari! Try this.
<template> <div id="codex-editor"></div> </template> <script> let EditorJS = null; if (process.client) { EditorJS = require('@editorjs/editorjs') } export default { mounted() { const editor = new EditorJS({ /** * Id of Element that should contain Editor instance */ holder: 'codex-editor' }); } } </script>
Thanks for the example
Hi @Yakumo-Yukari! Try this.
<template> <div id="codex-editor"></div> </template> <script> let EditorJS = null; if (process.client) { EditorJS = require('@editorjs/editorjs') } export default { mounted() { const editor = new EditorJS({ /** * Id of Element that should contain Editor instance */ holder: 'codex-editor' }); } } </script>
it's works, but how import tools?
Hi @Yakumo-Yukari! Try this.
<template> <div id="codex-editor"></div> </template> <script> let EditorJS = null; if (process.client) { EditorJS = require('@editorjs/editorjs') } export default { mounted() { const editor = new EditorJS({ /** * Id of Element that should contain Editor instance */ holder: 'codex-editor' }); } } </script>it's works, but how import tools?
Thank you so much for your help.
Most helpful comment
Hi @Yakumo-Yukari! Try this.