Parsing Vue2 SFC automatically generates documents and supports multiple document formats, including Markdown, Docx, PDf, HTML, and more.
解析 Vue2 SFC 自动生成文档,支持多种文档格式,包括 Markdown、DOCX、PDF、HTML 等等。
安装工具
npm install -g vue2-sfc-document
扫描所有组件
sfcdoc scan . --output ./docs
或者干脆指定某个 Vue 组件
sfcdoc scan HelloPanel.vue --output ./docs
To view more CLI commands, run sfcdoc --help on the terminal. 更多的 CLI 命令可以在终端输入 sfcdoc --help 查看
文档格式
# You can specify the format of the generated file.
# 指定文档格式
sfcdoc scan HelloPanel.vue --output ./docs --types 'md,pdf,json,docx,html'
文档名称
# When scanning only one Vue component, you can specify the name of the generated document, but the suffix is ignored.
# 只扫描一个 Vue 组件时,可以指定生成的文档名称,不过后缀名会被忽略
sfcdoc scan HelloPanel.vue --output ./docs --file hello-panel --types md pdf json docx html
生成多文档
# If the --multiple, -M argument is added, multiple copies of the document will be generated.
# 如果补充 --multiple 或 -M 参数,文档会被生成多份
sfcdoc scan ./projectName --multiple --output ./docs --types pdf