@kungal/editor-vue
| Install | |
|---|---|
npm install @kungal/editor-vue |
|
| Latest Version: | 0.38.4 |
| Vue: | 3 |
| License: | AGPL-3.0-only |
| Last Updated: | Oct 21, 2026 |
| Links: | GitHub · npm |
@kungal/editor-vue
The Vue 3 render layer of KunEditor: the <KunEditor> component (dual
WYSIWYG preview + markdown-source), its toolbar and the Vue plugin views
(mention dropdown, sticker/emoji picker). Consumes
@kungal/editor-core for the plugin brain.
Headless — ships zero CSS. The component only renders stable class hooks
(.kun-editor__*, .kun-mention-dropdown*) + data-* state; you own the look.
Import the reference stylesheet @kungal/editor-nuxt/editor.css
(themed with KunUI tokens), copy it, or write your own. It works in any Vue 3 app;
@kungal/editor-nuxt adds Nuxt auto-import sugar.
Usage
<script setup lang="ts">
import { KunEditor, type KunEditorAdapters } from '@kungal/editor-vue'
// Headless: bring your own styles, or use the KunUI-themed reference sheet.
import '@kungal/editor-nuxt/editor.css'
const markdown = ref('')
const adapters: KunEditorAdapters = {
uploadImage: (file) => api.uploadTopicImage(file),
searchMentionUsers: (q) => oauth.searchUsers(q),
notify: (msg, level) => toast(msg, level)
}
</script>
<template>
<KunEditor v-model="markdown" :adapters="adapters" locale="zh-cn" />
</template>
For an image-free editor (e.g. a short intro field), just omit
uploadImage — the upload button, paste/drop and sticker paths disappear with
no other config.
Peer dependencies
Install the Milkdown stack once in the host (single ProseMirror instance):
pnpm add @kungal/editor-vue @kungal/editor-core vue \
@milkdown/kit @milkdown/prose @milkdown/vue
Enable optional plugins by also installing their peers: katex (LaTeX, also
import katex/dist/katex.min.css), the @codemirror/* packages + codemirror
(code blocks and the markdown-source view).
Status
P3 complete. <KunEditor> is a real Milkdown dual-view editor: a WYSIWYG
view built from @kungal/editor-core/preset (createKunEditorPlugins — spoiler /
katex / code-block / mention / upload / …) and a CodeMirror markdown-source view,
over one v-model. The prop/emit surface (v-model, adapters, features,
locale, readonly) is stable.
A formatting toolbar is wired: bold / italic / strikethrough / inline code,
H1–H3, bullet & ordered lists, blockquote, code block, divider, spoiler, LaTeX —
plus an image-upload button when uploadImage is supplied. It's self-contained
(inline SVG, no @kungal/ui-vue dependency), themed through CSS variables so a
KunUI host still gets matching colours.
The @mention autocomplete dropdown is wired: type @, and — when the host
supplies searchMentionUsers — a debounced, keyboard-navigable dropdown offers
users and inserts a mention chip ([@name](https://github.com/kungal/kun-editor/blob/HEAD/kungal-user:id)). Without the adapter
the mention schema still round-trips; there's just no autocomplete.
The sticker / emoji picker is a toolbar popover: a built-in emoji tab
(unicode, inserted as text — no adapter) plus a sticker tab that appears when the
host supplies stickerSource, inserting each sticker as an image node. Turn the
whole picker off with features.sticker: false.
The markdown-source view (the "Markdown" tab) is a CodeMirror editor with
markdown highlighting, sharing the code block's kunCM theme. Edits sync back
through v-model to the WYSIWYG view.
Next: P4 — adopt in the forum, replacing its in-repo components/kun/milkdown
with real adapters. See
../../docs/architecture.md § migration.
Build
pnpm --filter @kungal/editor-vue build # vite lib build + vue-tsc d.ts → dist
pnpm --filter @kungal/editor-vue typecheck
Related Packages
KunEditor Nuxt Layer — wraps @kungal/editor-vue and auto-imports so an existing...
WYSIWYG Markdown editor for Vue 3 based on Milkdown, with Cocoar Design System s...
AIMD (Airalogy Markdown) editor with Monaco source mode and Milkdown WYSIWYG mod...
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.38.4 | ^3.5.0 | AGPL-3.0-only | |
| 0.38.3 | ^3.5.0 | AGPL-3.0-only | |
| 0.38.2 | ^3.5.0 | AGPL-3.0-only | |
| 0.38.1 | ^3.5.0 | AGPL-3.0-only | |
| 0.38.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.37.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.36.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.35.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.34.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.33.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.32.1 | ^3.5.0 | AGPL-3.0-only | |
| 0.32.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.31.1 | ^3.5.0 | AGPL-3.0-only | |
| 0.31.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.30.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.29.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.28.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.27.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.26.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.25.2 | ^3.5.0 | AGPL-3.0-only | |
| 0.25.1 | ^3.5.0 | AGPL-3.0-only | |
| 0.25.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.24.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.23.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.22.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.21.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.20.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.19.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.18.0 | ^3.5.0 | AGPL-3.0-only | |
| 0.17.0 | ^3.5.0 | AGPL-3.0-only |
Showing the latest 30 of 45. See every release on npm