npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tiptap-vue-pro-naive

v0.1.7

Published

Tiptap Vue Pro 的 Naive UI 适配:开箱即用的富文本编辑器组件

Readme

Tiptap Vue Pro Naive

English: README.en-US.md

基于 Tiptap v3 + Vue 3 + Naive UI 的开箱即用富文本编辑器组件。

能力

  • 开箱即用工具栏:标题、格式化、字体、字号、行高、缩进、颜色、高亮、对齐
  • 链接、图片上传/网络图片、视频/音频/文件上传、表格网格、列宽拖动、行列抓手、区域选择、Markdown 导入导出
  • Slash Command 快捷插入:输入 / 可搜索并插入标题、待办、列表、表格、图片、分割线和代码块
  • Ctrl/⌘ + F 查找替换:匹配高亮、上/下一个、大小写敏感、替换当前和替换全部
  • 全屏、预览、暗色模式、字数统计

字体、字号、行高、缩进、表格列宽、Slash Command 和查找替换交互属于编辑器体验能力;导出 Markdown 时不会保留这些 UI 行为。

安装

pnpm add tiptap-vue-pro-naive naive-ui
pnpm add @tiptap/core @tiptap/pm @tiptap/vue-3

用法

<script setup lang="ts">
import { ref } from 'vue'
import { ProEditorNaive } from 'tiptap-vue-pro-naive'
import 'tiptap-vue-pro-naive/style.css'

const content = ref('<p>hello world</p>')
</script>

<template>
  <ProEditorNaive v-model="content" />
</template>

配置

locale 控制内置文案语言(支持 zh-CN / en-US 和局部覆盖);toolbar 控制内置按钮的显示和顺序;toolbarOptions 控制菜单数据,如字体、字号、行高、颜色、代码语言、分割线样式、表格网格、Markdown 和打印;editorBehaviorOptions 控制默认行为,如链接打开方式、表格是否带表头、图片和媒体附件的 accept、大小上限、多选和渲染方式。

<script setup lang="ts">
import { ref } from 'vue'
import {
  ProEditorNaive,
  type EditorBehaviorOptions,
  type ToolbarOptions,
  type UploadAsset,
} from 'tiptap-vue-pro-naive'

const content = ref('<p>hello world</p>')

const toolbarOptions: ToolbarOptions = {
  fontFamilies: [
    { label: '默认字体', value: '' },
    { label: '苹方', value: 'PingFang SC' },
  ],
  fontSizes: ['', '14px', '16px', '20px', '28px'],
  lineHeights: ['', '1.5', '1.75', '2'],
  codeBlockLanguages: [
    { label: 'TypeScript', value: 'typescript' },
    { label: 'Python', value: 'python' },
  ],
  horizontalRules: [
    { label: '实线', value: 'solid' },
    { label: '虚线', value: 'dashed' },
  ],
  tableGrid: { maxRows: 12, maxCols: 12 },
}

const editorBehaviorOptions: EditorBehaviorOptions = {
  link: { defaultTarget: '_self' },
  table: { withHeaderRow: false },
  image: { accept: 'image/png,image/jpeg,image/webp', maxSize: 10 * 1024 * 1024, multiple: true, allowUrl: true },
  media: {
    video: { accept: 'video/mp4,video/webm', maxSize: 100 * 1024 * 1024, multiple: true },
    audio: { accept: 'audio/mpeg,audio/wav', maxSize: 30 * 1024 * 1024, multiple: true },
    file: {
      accept: '.pdf,.doc,.docx,.xls,.xlsx,.zip',
      maxSize: 50 * 1024 * 1024,
      multiple: true,
      render: { showSize: true, showMimeType: true, showUploadedAt: true },
    },
  },
}

const uploadAsset: UploadAsset = async (file, kind) => {
  const formData = new FormData()
  formData.append('file', file)
  formData.append('kind', kind)
  const res = await fetch('/api/upload-asset', { method: 'POST', body: formData })
  return await res.json()
}
</script>

<template>
  <ProEditorNaive
    v-model="content"
    locale="en-US"
    :toolbar-options="toolbarOptions"
    :editor-behavior-options="editorBehaviorOptions"
    :upload-asset="uploadAsset"
  />
</template>

完整配置项见文档站: https://twoer.github.io/tiptap-vue-pro/guide/configuration

自定义工具栏

<script setup lang="ts">
import { ref } from 'vue'
import { NButton } from 'naive-ui'
import { ProEditorNaive, type ToolbarConfig } from 'tiptap-vue-pro-naive'

const content = ref('<p>hello world</p>')
const toolbar: ToolbarConfig = [
  ['undo', 'redo'],
  ['bold', 'italic', 'underline'],
  ['link', 'image'],
]
</script>

<template>
  <ProEditorNaive v-model="content" :toolbar="toolbar">
    <template #toolbar-after="{ ctx }">
      <NButton text @click="ctx.commands.hr('dashed')">虚线</NButton>
    </template>
  </ProEditorNaive>
</template>

:toolbar="false" 可隐藏内置按钮;使用 toolbar 插槽可完全替换内置工具栏。

完整文档: https://twoer.github.io/tiptap-vue-pro/ 在线 Demo: https://twoer.github.io/tiptap-vue-pro/playground/