0.0.3 • Published 10 months ago

@sl-theia/vis-plugin-apidoc v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

@vises/vis-plugin-apidoc

A umi plugin

Install

pnpm i @sl-theia/vis-plugin-apidoc

Usage

Configure in .umirc.ts,

export default {
  plugins: [["@sl-theia/vis-plugin-apidoc"]],
};

使用

在 vis 创建项目中,src 下创建 api 文件夹,里面新建 api 文件

在每个文件头 // title: 页面描述 用作生成的文件名称

每个接口函数处使用注释

/**
 * @description 接口描述
 * @url {GET} api请求地址
 * @img https://img-blog.csdnimg.cn/img_convert/0548d4d186b025d0cbe6da3a38bfb20e.png  截图非必填
 * @param str {string}  - 必传参数
 * @param option {string}  - 必传参数
 * @param cb [string] - 可传参数
 * @returns name {string}  - 名字
 * @returns value {object[]}  - test
 * @returns value.name {string}  - 数组属性1
 * @returns value.num {number}  - 数组值1
 */
export const Test = () => {
  console.log("这是示例");
};

生成示例

Alt text

LICENSE

MIT

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago