当前位置: 首页 > news >正文

vue中使用js-doc

安装依赖

安装vue-template-compiler

npm install ​vue-template-compiler​

安装minami

npm install minami

安装js-doc

npm install js-doc

根目录下创建 .jsdoc.conf.json

内容:

{"tags": {"allowUnknownTags": true,// 指定所用词典"dictionaries": ["jsdoc"]},// 查找文件的深度 需要用 -r 参数"recurseDepth": 10,"source": {"include": [// 需要编译的文件路径 使用时请替换"./src/index/packages"],"includePattern": ".+\\.(vue)$","excludePattern": "(^|\\/|\\\\)_"},// 使用插件"plugins": [// 插件路径"./jsdoc-vue"],"templates": {"cleverLinks": false,"monospaceLinks": true,"useLongnameInNav": false,"showInheritedInNav": true},"opts": {// 文档输出路径"destination": "./src/index/doc","encoding": "utf8","private": true,"recurse": true,// 使用模板 minami"template": "./node_modules/minami"}
}

根目录创建 jsdoc-vue.js

内容:

var compiler = require("vue-template-compiler");exports.handlers = {// 利用 vue-template-compiler 编译 vue 模板beforeParse: function(e) {if (/\.vue$/.test(e.filename)) {var output = compiler.parseComponent(e.source);e.source = output.script ? output.script.content : "";}}
};

package.json

内容:

 "doc": "jsdoc -r -c .jsdoc.conf.json"

使用npm run doc 运行

http://www.lryc.cn/news/281663.html

相关文章:

  • Hive知识点
  • android自启动
  • cookie、Web Storage
  • 【rk3568】01-环境搭建
  • 编程笔记 html5cssjs 036 CSS概述
  • Vue入门七(Vuex的使用|Vue-router|LocalStorage与SessionStorage和cookie的使用)
  • 多级缓存架构(三)OpenResty Lua缓存
  • 写点东西《Docker入门(上)》
  • chatgpt实用技巧之二反问式提示
  • 【数据结构和算法】奇偶链表
  • MVC框架
  • 学习笔记之——3D Gaussian Splatting及其在SLAM与自动驾驶上的应用调研
  • Github Copilot 的使用方法和快捷键
  • 开源iMES工厂管家 - 详细安装部署指南(图解)- 全网独稿
  • Codeforces Round 919 (Div. 2)
  • 面向经验丰富的开发人员的最佳 Linux 发行版
  • Rust-借用检查
  • xcode安装及运行源码
  • x-cmd pkg | czg - git commit 智能生成工具
  • Go的并发练习题目
  • Python 网络编程之粘包问题
  • 旧衣回收小程序搭建:降低企业成本,提高回收效率!
  • Jmeter后置处理器——JSON提取器
  • [SWPUCTF 2022 新生赛]奇妙的MD5
  • MHFormer 论文解读
  • Python列表append()函数使用详解
  • 第08章_面向对象编程(高级)拓展练习(关键字:static,代码块,关键字:final,抽象类和抽象方法,接口,内部类,枚举类,注解,包装类)
  • 分布式光伏运维平台在提高光伏电站发电效率解决方案
  • 2024.1.14~1.20 周内刷题总结
  • 徐州数字孪生元宇宙赋能工业智能制造,助力传统制造业数字化转型