jodit-vue is a Vue.js wrapper component for the Jodit WYSIWYG editor, facilitating its integration into Vue 2 and Vue 3 applications. The package's current stable version is 3.1.0, designed specifically for Vue 3 projects. Earlier major versions, such as 2.x, cater to Vue 2 compatibility. This library offers a declarative approach to embed the rich text editor, managing its lifecycle and data binding through the standard `v-model` directive. It supports extensive customization, allowing developers to define toolbar buttons, add custom extensions, and apply comprehensive Jodit editor configurations via a dedicated `config` prop. A key differentiator is its minimalist design: it does not bundle Jodit's core CSS styles, requiring users to explicitly import `jodit/build/jodit.min.css`. This design choice maintains a lightweight wrapper while ensuring flexibility for diverse build environments.
npm install jodit-vueVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the setup of `jodit-vue` in a Vue 3 application, including the essential CSS import, component registration, and basic usage with `v-model` and a custom configuration object for the toolbar.
For Vue 2 applications, you must use `jodit-vue` version 2.x. Ensure your `package.json` specifies the correct major version range (e.g., `"jodit-vue": "^2.0.0"` for Vue 2 or `"jodit-vue": "^3.0.0"` for Vue 3).
Always include `import 'jodit/build/jodit.min.css'` in your application's entry point or component where the editor is used. Ensure `jodit` is installed as a dependency to provide this file.
Pass a `config` prop to the `JoditEditor` component. Refer to the Jodit documentation for available configuration options. For example: `<JoditEditor :config="{ buttons: ['bold', 'italic'] }" />`.Ensure `jodit` is installed (`npm install jodit --save` or `yarn add jodit`) and verify the import statement is `import 'jodit/build/jodit.min.css'`.
Add `import 'jodit/build/jodit.min.css'` to your application's main entry file (e.g., `main.js`/`main.ts`) or the component where `JoditEditor` is used.
Verify your `jodit-vue` version matches your Vue version. Use `jodit-vue@^2.0.0` for Vue 2 and `jodit-vue@^3.0.0` for Vue 3. Adjust your `package.json` accordingly and reinstall dependencies.