A API documentation generator for Vue3 single file component.

Related tags

Vue.js doc-vue
Overview

doc-vue

A API documentation generator for Vue3 single file component.

Table of Contents

Installation

# for local
npm i doc-vue

# or for global
npm i -g doc-vue

Documentation Syntax

Add a comment beginning with "@doc" as api description at the "slot", "props", "emits", "methods" declarations in the code.

<template>
  <div class="component-crt-crud">
    <!-- @doc the custom actions buttons -->
    <slot name="customAction"></slot>
    <!-- @doc the modal content -->
    <slot name="modal"></slot>
  </div>
</template>
<script lang="ts">
  import { defineComponent} from 'vue';
  export default defineComponent({

    props: {
      // @doc name of crud
      crudName: {
        type: String,
        default: '',
      },
      // @doc modal form fieds
      modalFormSchema: {
        type: Array as PropType<SearchSchema[]>,
        default: () => [],
      },
    },

    emits: [
      // @doc download button click event
      'downloadClick',
    ],

    setup() {
      return {};
    },
    methods: {
      /**
       * @doc show detal 
       * @param record detail data object
       */
      async show(record: BaseObject) {
        //...
      },

      // @doc fetch table data 
      async fetchList() {
        //...
      },
    },
  });
</script>

Command Line Usage

docvue xxx.vue xxx.json

"xxx.vue" is the path of your vue file , "xxx.json" is the path of your API documentation file.

Output Document Format

Based on the suffix of the input documentation file, the API documentation will be automatically generated in one of the following formats: "json\md\html", the default is "json". See demo.

# Output a json documentation
docvue xxx.vue xxx.json

# Output a markdown documentation
docvue xxx.vue xxx.md

# Output a html documentation
docvue xxx.vue xxx.html

Programmatic Usage

docvue is a function that accepts 2 parameters, the first is the source string and the second is the options object, returns the document data.

const docvue = require('doc-vue');
const code = `your code`;
const result = docvue(code);  // by default, result is json object
const mdResult = docvue(code, {type: 'md'});  // mdResult is markdown string
const htmlResult = docvue(code, {type: 'html'});  // htmlResult is html string

Options

type

Specify the type of document, input one of them: "json\md\html",default is "json"

License

MIT

You might also like...

Create coupled parent-child component pairs with composition API.

vue-coupled Background See discussion here. This package serves as a POC that: Allows any level of component encapsulation for child components. Suppo

Jul 1, 2022

OSI helps you to track your all open-source Internships and Program in a single place ⚡

OSI helps you to track your all open-source  Internships and Program in a single place ⚡

Open Source Internships Overview 👀 Dark Theme Light Theme Run locally 🛠 Fork this repo. open-source-internships 🚀 Clone the repo. ⏬ git clone https

Jan 2, 2023

A headless, single-page dashboard application for Shoplix

Configure API address cd ui-domain vi api.js set api address // development environment export const dev = { base: 'your api address', seller: 'yo

May 5, 2022

A headless, single-page dashboard application for Shoplix

Configure API address cd ui-domain vi api.js set api address // development environment export const dev = { base: 'your api address', seller: 'yo

Apr 22, 2022

📝 Minimalistic Vue-powered static site generator

📝 Minimalistic Vue-powered static site generator

VuePress 2 is coming! Please check out vuepress-next. Documentation Check out our docs at https://vuepress.vuejs.org/. Showcase Awesome VuePress vuepr

Jan 4, 2023

🌊 A flexible and fun JavaScript file upload library

🌊 A flexible and fun JavaScript file upload library

A JavaScript library that can upload anything you throw at it, optimizes images for faster uploads, and offers a great, accessible, silky smooth user

Jan 7, 2023

Restream is a module that allows you to create a stream of an audio/video file from the Firebase storage, protected from direct download through the client-side.

nuxt-restream Restream is a module that allows you to create a stream of an audio/video file from the Firebase storage, protected from direct download

Dec 13, 2022

Auto generate the corresponding `.env` file.

unplugin-vue-dotenv Auto generate the corresponding .env file. Install npm i unplugin-vue-dotenv Vite // vite.config.ts import Dotenv from 'unplugin-v

Dec 24, 2022

Mimic tree-shaking behaviour when importing code from an entry file in development mode.

vite-plugin-entry-shaking Mimic tree-shaking behaviour when importing code from an entry file in development mode. Warning This plugin is experimental

Dec 19, 2022
Owner
annnhan
annnhan
A simple, customization star rating component for your vue3 projects

vue3-star-ratings A simple, customizable component for star ratings Documentation Features Uses svg for the stars, so it can scale without quality los

Abiodun Olunu 14 Oct 7, 2022
A text replacer component for vue3.

A text replacer component for Vue 3. Requires Vue 3 as peer-dependency. Installation Install it from npm. npm install vue3-replacer pnpm add vue3-rep

Kadir Yazıcı 4 Feb 19, 2022
🎉🎉使用Vite + Vue3 + TypeScript + Element-plus + Mock开发的后台管理系统🎉🎉

Vite-Vue-Admin 介绍 Cli 配置 vue3.X vuex@4 vue-router@4 vite@2 typescript mock 内置 element-plus 二开封装 upload-file (文件上传,支持指定文件格式,文件大小) powerful-table (多功能表格

PengXiaoShuai 103 Dec 17, 2022
使用 vue3 来实现俄罗斯方块

Tetris-vue3 使用 vue3 实现俄罗斯方块 单机版本实现 联机版本实现 实现原理 采用了 Functional Core, Imperative Shell 模式来实现 提高了可测试性 业务核心逻辑和视图逻辑拆分 可以移植到任意 UI 库 todo 游戏重来 收获 应用程序从 0 到 1

阿崔cxr 29 Mar 25, 2022
vite2.7 + vue3.2 + ts + eslint + prettier

vite-vue-template 一个vue3项目模板 主要依赖 vite 2.7.2 vue 3.2.25 typescript eslint prettier 准备 Windows系统下将编辑器 行尾(eol) 设置为 LF('\n') vscode配置: { "files.eol":

shaaaaaaaa 5 Sep 13, 2022
⏳ vue3 + electron + ts + vite = mini template

v3-electron ?? Electron16 + Vue3 + Vite2 运行项目 # enter the project directory cd v3-electron # install dependency yarn # develop yarn dev # build exe

UNPany 8 Nov 11, 2022
vite+vue3.2+setup+elementPlus+eslint+js+stylelint

前期准备工作,npm包和vscode配置 !!!很重要,关乎整个Vue3开发阶段的代码提示 Volar使用 使用Vue3开发需要禁用vscode插件Vetur 然后安装 Volar(Vue Language Features),这样Vue3代码提示即使是使用js开发也非常友好 如果volar没有任何

null 2 Feb 8, 2022
vue3 + vite + typescript template

Vue 3 + Typescript + Vite This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 <script setu

BrowLi 6 Aug 1, 2022
Vue3 SSR prod-ready multi-languages template

vue3-ssr-template About This template is a prod ready starter for your Vue SSR application where you can do what you want at any level, client or serv

null 9 Mar 11, 2022
:clipboard: A schema-based form generator component for Vue.js

vue-form-generator A schema-based form generator component for Vue.js. Demo JSFiddle simple example CodePen simple example Features reactive forms bas

VueJS Generators 2.9k Dec 27, 2022