1. @vant/markdown-vetur
simple parse markdown to vue component description for vetur auto-completion
@vant/markdown-vetur
Package: @vant/markdown-vetur
Created by: youzan
Last modified: Wed, 02 Nov 2022 09:38:01 GMT
Version: 2.3.0
License: MIT
Downloads: 220
Repository: https://github.com/youzan/vant

Install

npm install @vant/markdown-vetur
yarn add @vant/markdown-vetur

Vant Markdown Vetur

将 .md 文件转换成能描述 vue 组件的 .json 文件,供 WebStorm 和 vscode 的 vetur 插件读取,从而可以在 vue 模版语法中拥有自动补全的功能。

Install

 # with npm
npm i @vant/markdown-vetur -D

# with yarn
yarn add @vant/markdown-vetur -D

# with pnpm
pnpm add @vant/markdown-vetur -D

API

parseAndWrite

解析目录下所有匹配的文件,并输出为 tags.json 和 attributes.json

 interface Options {
  // 需要解析的文件夹路径
  path: PathLike;
  // 文件匹配正则
  test: RegExp;
  // 输出目录
  outputDir: string;
  // 递归的目录最大深度
  maxDeep?: number;
  // 解析出来的组件名前缀
  tagPrefix?: string;
}

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin