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

@zixinit/vue-wangeditor-plus

v0.1.1

Published

A Vue 3 WangEditor wrapper with source editing, image sizing, attachment upload, and shared upload progress.

Downloads

173

Readme

@zixinit/vue-wangeditor-plus

Vue 3 的 WangEditor 封装组件,内置:

  • 源码编辑,使用 CodeMirror 高亮
  • 图片自定义宽高编辑面板
  • 一键排版
  • 上传图片、上传视频、上传附件
  • 图片/视频/附件共用上传进度浮层
  • 粘贴图片上传
  • 全屏样式修正

本地调试

pnpm install
pnpm dev

打开 Vite 输出的地址。playground/ 会直接引用 src/WangEditorPlus.vue,所以改源码后刷新页面即可验证。

打包

pnpm build

产物输出到 dist/

本地模拟 npm 安装

make pack

然后在业务项目中安装生成的 .tgz

pnpm add /path/to/zixinit-vue-wangeditor-plus-0.1.0.tgz

发布

发布流程由根目录 Makefile 管理:

make help
make preflight
make publish

完整说明见 DEPLOY.md

使用

安装包和 peer dependencies:

pnpm add @zixinit/vue-wangeditor-plus @wangeditor/[email protected] @wangeditor/[email protected]

注意:@wangeditor/editor-for-vue 的 npm latest tag 当前指向 Vue2 版本 1.0.2,Vue3 项目需要显式安装 5.1.12

<template>
  <WangEditorPlus
    v-model="content"
    height="620px"
    min-width="375px"
    scroll
    show-character-count
    :upload="upload"
  />
</template>

<script setup lang="ts">
import { ref } from "vue";
import WangEditorPlus from "@zixinit/vue-wangeditor-plus";
import "@zixinit/vue-wangeditor-plus/style.css";
import type { UploadKind } from "@zixinit/vue-wangeditor-plus";

const content = ref("");

async function upload(file: File, context: { kind: UploadKind; path: string }) {
  const formData = new FormData();
  formData.append("file", file);
  formData.append("path", context.path);

  const response = await fetch("/api/upload", {
    method: "POST",
    body: formData,
  });
  const data = await response.json();
  return data.url;
}
</script>

上传接口

组件不绑定具体业务上传器,只通过 upload prop 调用外部逻辑。

type UploadKind = "image" | "video" | "file";

type UploadHandler = (
  file: File,
  context: {
    kind: UploadKind;
    path: string;
  },
) => Promise<string | { url?: string; path?: string }>;

默认路径:

  • 图片:${uploadPath}/image
  • 视频:${uploadPath}/video
  • 附件:${uploadPath}/file

也可以分别传:

  • imageUploadPath
  • videoUploadPath
  • fileUploadPath

如果后端返回的是相对路径,可以传 resolveUploadUrl 做 URL 转换。