vue2-ueditor-plus-editor
| Install | |
|---|---|
npm install vue2-ueditor-plus-editor@0.1.11 |
|
| Latest Version: | 0.1.11 |
| Vue: | 2 |
| License: | MIT |
| Last Updated: | Jun 30, 2026 |
| Links: | npm |
vue2-ueditor-plus-editor
Vue 2 wrapper for UEditorPlus.
It provides:
UEditor: editor componentURichTextPreview: preview component with code highlightingvue2-ueditor-plus copy-assets: CLI for copying static assets into your project
Install
Install both packages:
npm install vue2-ueditor-plus-editor ueditor-plus-assets
or:
pnpm add vue2-ueditor-plus-editor ueditor-plus-assets
Copy Assets
UEditorPlus still needs static assets such as ueditor.all.js, language files, dialogs, themes, and images.
Copy them into your project:
npx vue2-ueditor-plus copy-assets public/static/ueditor-plus
A common setup is to run it automatically after install:
{
"scripts": {
"ueditor:assets": "vue2-ueditor-plus copy-assets public/static/ueditor-plus",
"postinstall": "vue2-ueditor-plus copy-assets public/static/ueditor-plus"
}
}
If you use a different public path, keep base-url aligned with the copied directory.
Basic Usage
<template>
<UEditor
v-model="content"
:height="360"
base-url="/static/ueditor-plus/"
:upload-url="uploadUrl"
/>
</template>
<script>
import { UEditor } from 'vue2-ueditor-plus-editor'
export default {
components: {
UEditor,
},
data() {
return {
content: '<p>Hello UEditorPlus</p>',
uploadUrl: '/api/upload',
}
},
}
</script>
Rich Text Preview
<template>
<div>
<UEditor
v-model="content"
:height="560"
base-url="/static/ueditor-plus/"
:upload-url="uploadUrl"
/>
<URichTextPreview :content="content" />
</div>
</template>
<script>
import { UEditor, URichTextPreview } from 'vue2-ueditor-plus-editor'
export default {
components: {
UEditor,
URichTextPreview,
},
data() {
return {
content: '',
uploadUrl: '/api/upload',
}
},
}
</script>
Multi Image Features
The package includes two custom tools:
dialogimg: single-row multi-imagebuttonimg: button multi-image
Enable them through toolbar configuration and keep multi-image-enabled turned on:
<template>
<UEditor
v-model="content"
:height="560"
base-url="/static/ueditor-plus/"
:upload-url="uploadUrl"
:multi-image-enabled="true"
:config="editorConfig"
/>
</template>
<script>
import { UEditor } from 'vue2-ueditor-plus-editor'
export default {
components: {
UEditor,
},
data() {
return {
content: '',
uploadUrl: '/api/upload',
editorConfig: {
allowDivTransToP: false,
toolbars: [[
'fullscreen',
'source',
'|',
'bold',
'italic',
'underline',
'|',
'simpleupload',
'insertimage',
'dialogimg',
'buttonimg',
'insertvideo',
'insertcode',
'|',
'searchreplace',
'preview',
]],
},
}
},
}
</script>
Built-in Behavior
The wrapper ships with a few defaults that solve common issues in admin systems:
autoFloatEnabled: falsePrevents the editor toolbar from becoming fixed while the page scrolls.catchRemoteImageEnable: falseKeeps pasted remote image URLs intact instead of rewriting them through remote-image capture.- Rich text preview supports code highlighting.
- Custom i18n is available for
zh-cn,zh-tw, anden.
Demo App
This repository includes a Vue 2 demo app:
pnpm install
pnpm --filter demo-vue2 dev
Demo source:
apps/demo-vue2/src/App.vue
The demo includes:
- basic editor usage
- rich text editing with preview
- email template editing
- multi-image toolbar actions
Local Publish Check
Before publishing, validate the package output:
cd packages/vue2-ueditor-plus
npm pack
If you also publish the assets package:
cd ../ueditor-plus-assets
npm pack
Notes
- This package targets Vue 2.
- Consumer projects must load the copied static assets through
base-url. - If the editor works locally but not in another project, check the copied
UEditorPlusstatic resources first.
Related Packages
Vue 2 adapter for Universal Rich Text Editor (Vue 2.6+ & 2.7)
Advanced and highly reusable Mobile UI Components built on Vue2 & You can define...
A safe Vue 2.7 renderer for the Article Content Protocol ProseMirror JSON format...
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.1.11 | ^2.6.12 | MIT | |
| 0.1.10 | ^2.6.12 | MIT | |
| 0.1.9 | ^2.6.12 | MIT | |
| 0.1.8 | ^2.6.12 | MIT | |
| 0.1.7 | ^2.6.12 | MIT | |
| 0.1.6 | ^2.6.12 | MIT | |
| 0.1.5 | ^2.6.12 | MIT | |
| 0.1.4 | ^2.6.12 | MIT | |
| 0.1.3 | ^2.6.12 | MIT | |
| 0.1.2 | ^2.6.12 | MIT | |
| 0.1.1 | ^2.6.12 | MIT | |
| 0.1.0 | ^2.6.12 | MIT | |
| 0.0.13 | ^2.6.12 | MIT | |
| 0.0.12 | ^2.6.12 | MIT |