vue中使用js-doc的案例代碼
安裝依賴
安裝vue-template-compiler
npm install ?vue-template-compiler
安裝minami
npm install minami
安裝js-doc
npm install js-doc
根目錄下創(chuàng)建 .jsdoc.conf.json
內(nèi)容:
{ "tags": { "allowUnknownTags": true, // 指定所用詞典 "dictionaries": [ "jsdoc" ] }, // 查找文件的深度 需要用 -r 參數(shù) "recurseDepth": 10, "source": { "include": [ // 需要編譯的文件路徑 使用時請?zhí)鎿Q "./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" } }
根目錄創(chuàng)建 jsdoc-vue.js
內(nèi)容:
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
內(nèi)容:
"doc": "jsdoc -r -c .jsdoc.conf.json"
使用npm run doc 運(yùn)行
到此這篇關(guān)于vue中使用js-doc的文章就介紹到這了,更多相關(guān)vue使用js-doc內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
vxe-table 實(shí)現(xiàn)行高拖拽功能示例詳解
vxe-table實(shí)現(xiàn)行高拖拽功能,需更新到最新版本,通過row-config.resizable和row-resize啟用,多列允許觸發(fā)行高拖拽時,通過row-resize指定任意列,感興趣的朋友跟隨小編一起看看吧2025-01-01Vue3實(shí)現(xiàn)vueFLow流程組件的詳細(xì)指南
VueFlow是一個專門為Vue.js框架設(shè)計的交互式可視化庫,它允許開發(fā)者輕松創(chuàng)建和管理復(fù)雜的圖形模型,如流程圖、狀態(tài)機(jī)、組織結(jié)構(gòu)圖等,本文給大家介紹了Vue3實(shí)現(xiàn)vueFLow流程組件的詳細(xì)指南,需要的朋友可以參考下2024-11-11element-ui?table表格控件實(shí)現(xiàn)單選功能代碼實(shí)例
這篇文章主要給大家介紹了關(guān)于element-ui?table表格控件實(shí)現(xiàn)單選功能的相關(guān)資料,單選框是指在?Element?UI?的表格組件中,可以通過單選框來選擇一行數(shù)據(jù)。用戶只能選擇一行數(shù)據(jù),而不能同時選擇多行,需要的朋友可以參考下2023-09-09從0搭建Vue3組件庫如何使用?glup?打包組件庫并實(shí)現(xiàn)按需加載
這篇文章主要介紹了從0搭建Vue3組件庫如何使用?glup?打包組件庫并實(shí)現(xiàn)按需加載,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2023-03-03詳解Vue單元測試Karma+Mocha學(xué)習(xí)筆記
本篇文章主要介紹了詳解Vue單元測試Karma+Mocha學(xué)習(xí)筆記,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-01-01