vue-wysiwyg

A WYSIWYG HTML editor for Vue.js
564,994
Install
npm install vue-wysiwyg
Latest Version:1.7.2
Vue:2
License:MIT
Last Updated:Jun 4, 2018
Links: npm
Maintainer: chmln

Usage

Install vue-wysiwyg

npm install vue-wysiwyg --save

OR

yarn add vue-wysiwyg

In your main.js:

import wysiwyg from "vue-wysiwyg";
Vue.use(wysiwyg, {}); // config is optional. more below

Also make sure to load the stylesheet. The exact syntax will depend on what preprocessor you use.

@import "~vue-wysiwyg/dist/vueWysiwyg.css";

In your components:

<wysiwyg v-model="myHTML" />

Config options

All keys are optional.

{
  // { [module]: boolean (set true to hide) }
  hideModules: { "bold": true },

  // you can override icons too, if desired
  // just keep in mind that you may need custom styles in your application to get everything to align
  iconOverrides: { "bold": "<i class="your-custom-icon"></i>" },

  // if the image option is not set, images are inserted as base64
  image: {
    uploadURL: "/api/myEndpoint",
    dropzoneOptions: {}
  },

  // limit content height if you wish. If not set, editor size will grow with content.
  maxHeight: "500px"
}

Available Modules:

  • bold
  • italic
  • underline
  • justifyLeft
  • justifyCenter
  • justifyRight
  • headings
  • link
  • code
  • orderedList
  • unorderedList
  • image
  • table
  • removeFormat
  • separator

Note on the image upload API endpoint:

  • Image is uploaded by multipart/form-data
  • Your endpoint must respond back with a string, the URL for the image - e.g. http://myapp.com/images/12345.jpg

Related Packages

@ddosdor/vue-sh-wysiwyg

Simple and very basic Wysiwyg editor for Vue.js

320 3
@dstepas/vue-wysiwyg

A WYSIWYG HTML editor for Vue.js

4,979 0
vue-wysiwyg-fixed

A WYSIWYG HTML editor for Vue.js

1,856
vue-wysiwyg-simple

A WYSIWYG HTML editor for Vue 2

644
@markweave/vue2

Vue 2 adapter for the Markweave Markdown-first WYSIWYG editor.

9,500 1

Version History

Version Released License
1.7.2 MIT
1.7.1 MIT
1.7.0 MIT
1.6.0 MIT
1.5.0 MIT
Pre-releases (3)
Version Released License
1.1.1-1 MIT
1.0.1-alpha
1.0.0-alpha