💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[TOC] ### 1. 介绍 > 给公共组件里的内容生成一个md文档说明,可在线预览 ### 2. 使用 #### 1. 新建vuese.config.js 或者 .vueserc ~~~ module.exports = { "include": ["src/components/**/*.vue"], "outDir": "src/components/docs", "markdownDir": "markdown", "genType": "docute", "title": "全局组件文档" } ~~~ #### 2. 配置package.json ~~~ { "name": "dme-admin", "version": "0.1.0", "private": true, "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", "lint": "vue-cli-service lint", + "docs": "vuese gen", + "see-docs": "vuese serve --open", "commit": "git-cz" }, "dependencies": { "axios": "^0.18.0", "echarts": "4.0.4", "element-ui": "^2.4.7", "js-cookie": "^2.2.0", "jsplumb": "^2.9.3", "jszip": "^3.2.2", "lodash": "^4.17.14", "mockjs": "^1.0.1-beta3", "normalize.css": "^8.0.0", "nprogress": "^0.2.0", "qs": "^6.5.2", "v-charts": "^1.19.0", "vue": "^2.5.17", "vue-g6-editor": "^0.2.0", "vue-router": "^3.0.1", "vuex": "^3.0.1" }, "devDependencies": { "@commitlint/cli": "^8.0.0", "@commitlint/config-conventional": "^8.0.0", "@vue/cli-plugin-babel": "^3.0.3", "@vue/cli-plugin-eslint": "^3.0.3", "@vue/cli-service": "^3.0.3", "@vue/eslint-config-airbnb": "^3.0.3", "commitizen": "^3.1.1", "cz-customizable": "^6.2.0", "husky": "^1.1.2", "lint-staged": "^8.0.3", "node-sass": "^4.9.0", "prettier": "^1.15.3", "sass-loader": "^7.0.1", "svg-sprite-loader": "^4.1.1", "vue-template-compiler": "^2.5.17" }, "lint-staged": { "src/**/*.{vue,js}": [ "prettier --write", "yarn lint", "git add" ], "src/**/*.{json,md,css,scss}": [ "prettier --write", "git add" ] }, "husky": { "hooks": { "pre-commit": "lint-staged", "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" } }, "config": { "commitizen": { "path": "node_modules/cz-customizable" } } } } ~~~ #### 3. 运行 ~~~ vuese gen //生成文档 vuese serve --open // 在线预览 ~~~ #### 4. 踩坑 > 1. 全局安装vuese ~~~ yarn global add @vuese/cli (建议在cmd安装) ~~~ > 2. 安装后说vuese不可用?? > 3. 将环境变量加在电脑上 > 4. 重启电脑!!!