@dicarbene/vue-editorjs
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Editorjs for vue3

Installation

To start using the library, install it in your project:

pnpm install @dicarbene/vue-editorjs
or
yarn add @dicarbene/vue-editorjs

Usage

For Vue 3

<!-- component.vue -->
<template>
  <EditorjsClient :data="dat" />
</template>

<script lang="ts" setup>
  import { EditorjsClient } from '@dicarbene/vue-editorjs'
  const dat = ref({})
</script>

For Nuxt 3

Define a nuxt plugin

// plugins/editorjs.client.ts
import { EditorjsClient } from '@dicarbene/vue-editorjs'

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.component('EditorjsClient', EditorjsClient)
})

Use EditorjsClient component anywhere in the Vue SFC

<!-- editor.vue -->
<template>
  <div>
    <ClientOnly>
      <EditorjsClient :data="dat" />
    </ClientOnly>
  </div>
</template>

<script setup lang="ts">
  const dat = ref({})
</script>

Add the build transpile.

// nuxt.config.ts
import { defineNuxtConfig } from 'nuxt/config'

export default defineNuxtConfig({
  ...
  build: {
    transpile: ['@dicarbene/vue-editorjs']
  }
})

Readme

Keywords

none

Package Sidebar

Install

npm i @dicarbene/vue-editorjs

Weekly Downloads

0

Version

0.1.3

License

none

Unpacked Size

1.84 MB

Total Files

7

Last publish

Collaborators

  • dicarbene