Editor.js: hi, how to use editor.js in nuxt.js, is there an example?

Created on 15 Feb 2020  路  5Comments  路  Source: codex-team/editor.js

How to use editor.js in nuxt.js, are there any related examples?

Most helpful comment

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>

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chouglesaud picture chouglesaud  路  3Comments

cossssmin picture cossssmin  路  3Comments

guillaumepn picture guillaumepn  路  4Comments

vsvanshi picture vsvanshi  路  4Comments

ghost picture ghost  路  4Comments