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 🙏

© 2025 – Pkg Stats / Ryan Hefner

milkdown-vue

v1.0.3

Published

milkdown vue 封装

Readme

milkdown-vue

基于milkdown的封装,整合了所有常用插件的Vue3组件 。

Demo

Install

yarn add milkdown-vue

Usage

模板代码

<editor v-model="doc" ref="editorRef" :config="config" :uploader="uploader" @save="save" />

Props

1、 v-model: markdown内容 2、 config: 组件配置相关 |属性|类型|默认值|说明| |--|--|--|--| |readonly|Boolean|false|是否为只读| |menu|Boolean|false|是否展示菜单| |theme|String|auto|主题样式auto、dark, light|

3、uploader: 图片上传自定义方法,接收原始图片文件,许返回包含图片地址的对象数组。

[{
  "url": "图片地址",
  "name": "名称"
}]

Event

save: 使用保存快捷键Mod+s时,接收value值的回调

快捷键

参考preset-gfm插件的快捷键。

这里新增加了Mod+/快捷键,可在不同的窗口编辑模式中切换

vue setup示例

// 组件引入
import Editor from 'milkdown-vue'
import { ref } from 'vue'
const editorRef = ref(null)
const config = ref({
  // 是否为只读模式
  readonly: false,
  // 是否展示菜单
  menu: true,
  // 主题样式auto、dark, light
  theme: 'auto'
})

const doc = ref('')

const save = v => {
  // markdown 内容字符串
  console.log(v)
}

// 自定义上传
const uploader = (images) => {
  // 图片原始文件数组对象
  console.log(images)
  // 返回上传后的地址和名称
  return [{
    url: "https://cyyjs.top/_nuxt/img/qrcode.5c9aef0.jpg",
    name: "head"
  }]
}

// 获取html内容
const getHtml = () => {
  console.log(editorRef.value.getHtml())
}
// 获取目录结构
const getOutline = () => {
  console.log(editorRef.value.getOutline())
}
// 设置markdown 内容
const setValue = (v) => {
  editorRef.value.setValue(v)
}