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 🙏

© 2024 – Pkg Stats / Ryan Hefner

vite-plugin-vue-docs-plus

v0.0.4

Published

vite plugin auto document generation for vue

Downloads

1

Readme

vite-plugin-vue-docs-plus

示例

项目参考:vite-plugin-vue-docs

插件配置

{
  // 文档路由地址
  base: string;
  // 组件路径 相对于 src
  componentDir: string;
  // router实例名称
  vueRoute?: string;
  // 显示使用指南(CHANGELOG.md 及 README.md)
  showUse?: boolean;
  // header
  header?: {
    // 网站header标题 默认取自项目 package.json 中的name
    title?: string;
    // 项目 github 地址
    github?:string
  };
}

组件库 说明文档

项目根目录 README.md 文件

组件库 更新日志文档

项目根目录 CHANGELOG.md 文件

组件说明 (在 script 标签中的第一个注释)

/**
 * 组件名称
 * @desc 组件描述
 * @navTitle 组件 // 组件所在分类
 * @navOrder 1 // 组件排序
 */

props 描述


props: {
  /**
   * 最大值 // prop 说明
   * @type 99|22 // 类型
   * @default 99 // 默认值 default 在注释中不存在时将使用 代码中的 default 字段
   */
  max: {
    type: Number,
    default: 99,
  },
  /**
   * 类型
   * @type primary|success|warning|info|danger
   */
  type: {
    type: String,
    default: "primary",
    validator: (val: string) => {
      return ["primary", "success", "warning", "info", "danger"].includes(
        val
      );
    },
  },
  /**
   * 对象
   * @default value {a:1}  // 对象类型 default 格式要改一下 此时  {a:1} 作为默认值
   */
  obj: {
    type: Array,
    default: () => ({a:1})
  },
}

emits

数组写法

emits: [
  // 更新 value
  "update:value",
];

对象写法

emits: {
  // 没有验证函数
  click: null,

  /**
   * 带有验证函数
   * 详细说明详细说明详细说明详细说明详细说明
   * @param {Object} payload 参数一
   * @param {Object} test 参数二
   * @param test1 参数三
   * @return Boolean
   */
  submit: (payload:any) => {
    if (payload.email && payload.password) {
      return true;
    } else {
      console.warn(`Invalid submit event payload!`);
      return false;
    }
  },
}

插槽注释

<!-- 测试插槽一 -->
<slot></slot>

组件额外文档

在组件目录下增加 README.md 文件,此文件将被解析并添加到当前组件文档的末尾

TODO

Props

  • default 为函数时

Event

setup 中的 method