chmln / vue-wysiwyg

A lightweight WYSIWYG HTML editor for Vue.js
https://chmln.github.io/vue-wysiwyg/
MIT License
555 stars 134 forks source link

Nuxt support #153

Open VladStepanov opened 2 years ago

VladStepanov commented 2 years ago

Is it possible to install to nuxt? I have tried to install, but im getting error

Unknown custom element: <Wysiwyg> - did you register the component correctly?

Repro: https://codesandbox.io/s/muddy-pond-v60mj?file=/pages/index.vue Check plugins/wysiwyg.js and nuxt.config.js

yasser17 commented 2 years ago

You need to follow the next steps:

1- Add a file into the plugins folder with the next code

import Vue from 'vue'
import wysiwyg from 'vue-wysiwyg'

import 'vue-wysiwyg/dist/vueWysiwyg.css'

Vue.use(wysiwyg, {HERE YOUR OPTIONS})

2 - import your plugins file in nuxt.config.js file

...

plugins: [
    { src: '~plugins/helpers.js' },
],
...