commit 0925d01fb8e5c44f2f4735009743b9a8fe13fb58 Author: gtz <535262213@qq.com> Date: Wed Oct 26 16:06:12 2022 +0800 'update' diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..438e12d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.vscode/ +.idea/ +node_modules/ +dist/ +**/*.log +LICENSE +README.md diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..b98ffa1 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,52 @@ +--- +kind: pipeline +type: docker +name: default + +steps: +- name: build + image: docker:dind + volumes: + - name: dockersock + path: /var/run/docker.sock + - name: dockerconfig + path: /root/.docker + commands: + - docker build -t harbor.picaiba.com/mes/mes-ui:hfxny-1.0.0 ./ && docker push harbor.picaiba.com/mes/mes-ui:hfxny-1.0.0 + +- name: deploy + image: harbor.picaiba.com/tools/kubectl:1.19.8 + commands: + - echo "172.27.0.20 lb.kubesphere.local" >> /etc/hosts + #- echo "52.74.223.119 github.com" >> /etc/hosts + - sleep 1 + - kubectl scale --replicas=0 deployment/mes-ui -n mes-hfxny + - sleep 3 + - kubectl scale --replicas=1 deployment/mes-ui -n mes-hfxny + depends_on: + - build + +- name: notification + image: lddsb/drone-dingtalk-message + settings: + token: 37a6483274f6de648a26d6710e4d8160eb7d471752abb2d70f8b7958af58fe11 + type: markdown + secret: SEC83b10f5fefd6127e4073360d4447bb7276a90386aeee1275b2797dd377a903e7 + tpl: http://res.picaiba.com/msg/msg.md + tips_title: 你有新消息 + success_color: 008800 + failure_color: FF0000 + +volumes: +- name: dockersock + host: + path: /var/run/docker.sock +- name: dockerconfig + host: + path: /root/.docker + +trigger: + branch: + - projects/hfxny + event: + - push diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..3454886 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# https://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..aec3a79 --- /dev/null +++ b/.env.production @@ -0,0 +1,7 @@ +# just a flag +ENV = 'production' + +# base api +VUE_APP_BASE_API = '/api' +VUE_APP_REPORT_DESIGN_URL = '/ureport/designer' +VUE_APP_REPORT_VIEW_URL = '/ureport/preview' \ No newline at end of file diff --git a/.env.staging b/.env.staging new file mode 100644 index 0000000..a8793a0 --- /dev/null +++ b/.env.staging @@ -0,0 +1,8 @@ +NODE_ENV = production + +# just a flag +ENV = 'staging' + +# base api +VUE_APP_BASE_API = '/stage-api' + diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..e6529fc --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +build/*.js +src/assets +public +dist diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..8437d8d --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,201 @@ +module.exports = { + root: true, + parserOptions: { + parser: 'babel-eslint', + sourceType: 'module' + }, + env: { + browser: true, + node: true, + es6: true, + }, + extends: ['plugin:vue/recommended', 'eslint:recommended'], + + // add your custom rules here + //it is base on https://github.com/vuejs/eslint-config-vue + rules: { + "vue/max-attributes-per-line": [2, { + "singleline": 10, + "multiline": { + "max": 1, + "allowFirstLine": false + } + }], + "vue/no-use-v-if-with-v-for": ["error", { + "allowUsingIterationVar": true + }], + "vue/singleline-html-element-content-newline": "off", + "vue/multiline-html-element-content-newline":"off", + "vue/name-property-casing": ["error", "PascalCase"], + "vue/no-v-html": "off", + 'accessor-pairs': 2, + 'arrow-spacing': [2, { + 'before': true, + 'after': true + }], + 'block-spacing': [2, 'always'], + 'brace-style': [2, '1tbs', { + 'allowSingleLine': true + }], + 'camelcase': [0, { + 'properties': 'always' + }], + 'comma-dangle': [2, 'never'], + 'comma-spacing': [2, { + 'before': false, + 'after': true + }], + 'comma-style': [2, 'last'], + 'constructor-super': 2, + 'curly': [2, 'multi-line'], + 'dot-location': [2, 'property'], + 'eol-last': 2, + 'eqeqeq': ["error", "always", {"null": "ignore"}], + 'generator-star-spacing': [2, { + 'before': true, + 'after': true + }], + 'handle-callback-err': [2, '^(err|error)$'], + 'indent': [2, 2, { + 'SwitchCase': 1 + }], + 'jsx-quotes': [2, 'prefer-single'], + 'key-spacing': [2, { + 'beforeColon': false, + 'afterColon': true + }], + 'keyword-spacing': [2, { + 'before': true, + 'after': true + }], + 'new-cap': [2, { + 'newIsCap': true, + 'capIsNew': false + }], + 'new-parens': 2, + 'no-array-constructor': 2, + 'no-caller': 2, + 'no-console': 'off', + 'no-class-assign': 2, + 'no-cond-assign': 2, + 'no-const-assign': 2, + 'no-control-regex': 0, + 'no-delete-var': 2, + 'no-dupe-args': 2, + 'no-dupe-class-members': 2, + 'no-dupe-keys': 2, + 'no-duplicate-case': 2, + 'no-empty-character-class': 2, + 'no-empty-pattern': 2, + 'no-eval': 2, + 'no-ex-assign': 2, + 'no-extend-native': 2, + 'no-extra-bind': 2, + 'no-extra-boolean-cast': 2, + 'no-extra-parens': [2, 'functions'], + 'no-fallthrough': 2, + 'no-floating-decimal': 2, + 'no-func-assign': 2, + 'no-implied-eval': 2, + 'no-inner-declarations': [2, 'functions'], + 'no-invalid-regexp': 2, + 'no-irregular-whitespace': 2, + 'no-iterator': 2, + 'no-label-var': 2, + 'no-labels': [2, { + 'allowLoop': false, + 'allowSwitch': false + }], + 'no-lone-blocks': 2, + 'no-mixed-spaces-and-tabs': 2, + 'no-multi-spaces': 2, + 'no-multi-str': 2, + 'no-multiple-empty-lines': [2, { + 'max': 1 + }], + 'no-native-reassign': 2, + 'no-negated-in-lhs': 2, + 'no-new-object': 2, + 'no-new-require': 2, + 'no-new-symbol': 2, + 'no-new-wrappers': 2, + 'no-obj-calls': 2, + 'no-octal': 2, + 'no-octal-escape': 2, + 'no-path-concat': 2, + 'no-proto': 2, + 'no-redeclare': 2, + 'no-regex-spaces': 2, + 'no-return-assign': [2, 'except-parens'], + 'no-self-assign': 2, + 'no-self-compare': 2, + 'no-sequences': 2, + 'no-shadow-restricted-names': 2, + 'no-spaced-func': 2, + 'no-sparse-arrays': 2, + 'no-this-before-super': 2, + 'no-throw-literal': 2, + 'no-trailing-spaces': 2, + 'no-undef': 2, + 'no-undef-init': 2, + 'no-unexpected-multiline': 2, + 'no-unmodified-loop-condition': 2, + 'no-unneeded-ternary': [2, { + 'defaultAssignment': false + }], + 'no-unreachable': 2, + 'no-unsafe-finally': 2, + 'no-unused-vars': [2, { + 'vars': 'all', + 'args': 'none' + }], + 'no-useless-call': 2, + 'no-useless-computed-key': 2, + 'no-useless-constructor': 2, + 'no-useless-escape': 0, + 'no-whitespace-before-property': 2, + 'no-with': 2, + 'one-var': [2, { + 'initialized': 'never' + }], + 'operator-linebreak': [2, 'after', { + 'overrides': { + '?': 'before', + ':': 'before' + } + }], + 'padded-blocks': [2, 'never'], + 'quotes': [2, 'single', { + 'avoidEscape': true, + 'allowTemplateLiterals': true + }], + 'semi': [2, 'never'], + 'semi-spacing': [2, { + 'before': false, + 'after': true + }], + 'space-before-blocks': [2, 'always'], + 'space-before-function-paren': [2, 'never'], + 'space-in-parens': [2, 'never'], + 'space-infix-ops': 2, + 'space-unary-ops': [2, { + 'words': true, + 'nonwords': false + }], + 'spaced-comment': [2, 'always', { + 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] + }], + 'template-curly-spacing': [2, 'never'], + 'use-isnan': 2, + 'valid-typeof': 2, + 'wrap-iife': [2, 'any'], + 'yield-star-spacing': [2, 'both'], + 'yoda': [2, 'never'], + 'prefer-const': 2, + 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, + 'object-curly-spacing': [2, 'always', { + objectsInObjects: false + }], + 'array-bracket-spacing': [2, 'never'] + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7dd5617 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +**/*.log + +tests/**/coverage/ +tests/e2e/reports +selenium-debug.log + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.local + +package-lock.json +yarn.lock +/.env.development +/vue.config.js diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..283ae68 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,12 @@ +{ + "semi": false, + "singleQuote": true, + "trailingComma": "none", + "useTabs": false, + "tabWidth": 2, + "htmlWhitespaceSensitivity": "ignore", + "vueIndentScriptAndStyle": false, + "embeddedLanguageFormatting": "off", + "bracketSameLine":false, + "printWidth": 120 +} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f4be7a0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: 10 +script: npm run test +notifications: + email: false diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7600b86 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM node:12 AS builder +WORKDIR /app +ADD package.json /app/ +RUN npm config set registry https://registry.npmmirror.com && npm install +ADD . /app +RUN npm run build:prod + +FROM busybox +LABEL maintainer thomas.hairong@gmail.com +COPY --from=builder /app/dist /html \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6151575 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-present PanJiaChen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/QR.png b/QR.png new file mode 100644 index 0000000..cd55834 Binary files /dev/null and b/QR.png differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..a34e76f --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ + +# Readme + + +页面原型地址: http://rp.picaiba.com/mes/2020-12-29 + +element 表单生成工具: https://mrhj.gitee.io/form-generator/#/ + +*** + +* 顶栏右上角设置的配置在 @/layout/components/Navbar.vue 中 +* 富文本编辑器中 右上角上传图片的目标地址需要修改,在@/components/Tinymce/components/EditorImage.vue 中 + + +##### echarts封装 +* 考虑使用mixin加入部分功能 +* option配置分离,再复用 +* 定义统一输入的数据格式(通过props?) + +##### 国际化注意事项 +* 所有methodbtn的tableBtn配置中的btnName写成下种形式,具体配置项在@/lang/i18n.js 中,若无想要的自行添加 +``` + btnName: 'btn.edit' +``` +* 所有hidden不为true的路由的mate中的title,写成下种形式,位置同上 +``` + meta: { title: routerTitle.dashboard.dashboard?.[language] || routerTitle.dashboard.dashboard.en, icon: 'dashboard', affix: true } +``` +* 所有table页引入国际化组件,表格配置项中label写成下种形式,具体配置需自行到@/lang/en.js 和@/lang/zh.js 中添加 +``` + import i18n from '@/lang' + const tableProps = [{ + ... + label: i18n.t('userManage.userId'), + ... + }] +``` + +##### 切换主题色 +* 主题样式文件应使用本地文件,不应使用element云上的(目前尝试使用本地可能因为缓存策略导致切换主题色仅第一次生效,目前仍保留使用element云上的样式文件) + +##### 备注 +* 废品报废添加时间隐藏,质量检测计划检测速率、检测内容隐藏 diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..6604e8d --- /dev/null +++ b/babel.config.js @@ -0,0 +1,26 @@ +/* + * @Date: 2020-12-14 09:07:03 + * @LastEditors: guo + * @LastEditTime: 2020-12-29 21:34:11 + * @FilePath: \basic-admin\babel.config.js + * @Description: 修改babel配置 + * preset-env用于适配浏览器(最新4个版本) + * transform-runtime 用于识别一些比较新的js语法 + */ +module.exports = { + presets: [ + ['@babel/preset-env', { + 'useBuiltIns': 'usage', + 'debug': true, + 'targets': [ + 'last 4 versions' + ] + }], + '@vue/app' + ], + plugins: [ + ['@babel/plugin-transform-runtime', { + 'corejs': 3 + }] + ] +} diff --git a/build/index.js b/build/index.js new file mode 100644 index 0000000..0c57de2 --- /dev/null +++ b/build/index.js @@ -0,0 +1,35 @@ +const { run } = require('runjs') +const chalk = require('chalk') +const config = require('../vue.config.js') +const rawArgv = process.argv.slice(2) +const args = rawArgv.join(' ') + +if (process.env.npm_config_preview || rawArgv.includes('--preview')) { + const report = rawArgv.includes('--report') + + run(`vue-cli-service build ${args}`) + + const port = 9526 + const publicPath = config.publicPath + + var connect = require('connect') + var serveStatic = require('serve-static') + const app = connect() + + app.use( + publicPath, + serveStatic('./dist', { + index: ['index.html', '/'] + }) + ) + + app.listen(port, function () { + console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) + if (report) { + console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) + } + + }) +} else { + run(`vue-cli-service build ${args}`) +} diff --git a/default.conf b/default.conf new file mode 100644 index 0000000..52f7bbf --- /dev/null +++ b/default.conf @@ -0,0 +1,50 @@ +server { + listen 80 default_server; + listen [::]:80 default_server; + + root /usr/share/nginx/html; + index index.html index.htm; + + location / { + try_files $uri $uri/ @rewrites; + } + + location /spc/ { + proxy_pass http://58.210.206.230:8000/; + } + + location /api { + access_log off; + add_header Access-Control-Allow-Origin * always; + add_header Access-Control-Allow-Methods GET,OPTIONS,POST,GET,PUT,DELETE always; + add_header Access-Control-Allow-Headers $http_access_control_request_headers; + add_header Access-Control-Allow-Credentials true; + add_header Access-Control-Max-Age 1800; + + if ($request_method = OPTIONS){ + add_header Access-Control-Allow-Origin * always; + add_header Access-Control-Allow-Methods GET,OPTIONS,POST,GET,PUT,DELETE always; + add_header Access-Control-Allow-Headers $http_access_control_request_headers; + add_header Access-Control-Allow-Credentials true; + add_header Access-Control-Max-Age 1800; + return 204; + } + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_buffering off; + proxy_pass http://mes:9090/api; + proxy_http_version 1.1; + } + + location @rewrites { + rewrite ^(.+)$ /index.html last; + } + + location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { + expires max; + add_header Pragma public; + add_header Cache-Control "public, must-revalidate, proxy-revalidate"; + } +} diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..143cdc8 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,24 @@ +module.exports = { + moduleFileExtensions: ['js', 'jsx', 'json', 'vue'], + transform: { + '^.+\\.vue$': 'vue-jest', + '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': + 'jest-transform-stub', + '^.+\\.jsx?$': 'babel-jest' + }, + moduleNameMapper: { + '^@/(.*)$': '/src/$1' + }, + snapshotSerializers: ['jest-serializer-vue'], + testMatch: [ + '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' + ], + collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'], + coverageDirectory: '/tests/unit/coverage', + // 'collectCoverage': true, + 'coverageReporters': [ + 'lcov', + 'text-summary' + ], + testURL: 'http://localhost/' +} diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..958df04 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@/*": ["src/*"] + } + }, + "exclude": ["node_modules", "dist"] +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..351fedd --- /dev/null +++ b/package.json @@ -0,0 +1,129 @@ +{ + "name": "vue-element-admin", + "version": "4.2.1", + "description": "A magical vue admin. An out-of-box UI solution for enterprise applications. Newest development stack of vue. Lots of awesome features", + "author": "Pan ", + "license": "MIT", + "scripts": { + "dev": "vue-cli-service serve", + "build:prod": "vue-cli-service build", + "build:stage": "vue-cli-service build --mode staging", + "preview": "node build/index.js --preview", + "lint": "eslint --ext .js,.vue src", + "test:unit": "jest --clearCache && vue-cli-service test:unit", + "test:ci": "npm run lint && npm run test:unit", + "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", + "new": "plop" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "src/**/*.{js,vue}": [ + "eslint --fix", + "git add" + ] + }, + "keywords": [ + "vue", + "admin", + "dashboard", + "element-ui", + "boilerplate", + "admin-template", + "management-system" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/PanJiaChen/vue-element-admin.git" + }, + "bugs": { + "url": "https://github.com/PanJiaChen/vue-element-admin/issues" + }, + "dependencies": { + "axios": "0.18.1", + "clipboard": "2.0.4", + "codemirror": "5.45.0", + "desandro-matches-selector": "^2.0.2", + "driver.js": "0.9.5", + "dropzone": "5.5.1", + "echarts": "4.2.1", + "element-ui": "2.13.0", + "ev-emitter": "^2.1.0", + "file-saver": "2.0.1", + "fizzy-ui-utils": "^3.0.0", + "fuse.js": "3.4.4", + "get-size": "^2.0.3", + "js-cookie": "2.2.0", + "jsonlint": "1.6.3", + "jszip": "3.2.1", + "lodash": "^4.17.15", + "masonry-layout": "^4.2.2", + "moment": "^2.27.0", + "normalize.css": "7.0.0", + "nprogress": "0.2.0", + "outlayer": "^2.1.1", + "path-to-regexp": "2.4.0", + "raphael": "git+https://gitee.com/shihairong/raphael", + "screenfull": "4.2.0", + "script-loader": "0.7.2", + "showdown": "1.9.0", + "sortablejs": "1.8.4", + "viewerjs": "^1.6.1", + "vue": "2.6.10", + "vue-bus": "^1.2.1", + "vue-count-to": "1.0.13", + "vue-i18n": "^8.22.2", + "vue-perfect-scrollbar": "^0.2.1", + "vue-router": "3.0.2", + "vue-splitpane": "1.0.4", + "vuedraggable": "2.20.0", + "vuex": "3.1.0", + "write-excel-file": "^1.4.6", + "xlsx": "0.14.1" + }, + "devDependencies": { + "@babel/core": "7.0.0", + "@babel/plugin-transform-runtime": "^7.12.10", + "@babel/preset-env": "^7.12.11", + "@babel/register": "7.0.0", + "@babel/runtime-corejs3": "^7.12.5", + "@vue/cli-plugin-babel": "3.5.3", + "@vue/cli-plugin-eslint": "^3.9.1", + "@vue/cli-plugin-unit-jest": "3.5.3", + "@vue/cli-service": "3.5.3", + "@vue/test-utils": "1.0.0-beta.29", + "autoprefixer": "^9.5.1", + "babel-core": "7.0.0-bridge.0", + "babel-eslint": "8.2.2", + "babel-jest": "23.6.0", + "chalk": "2.4.2", + "chokidar": "2.1.5", + "connect": "3.6.6", + "eslint": "5.15.3", + "eslint-plugin-vue": "5.2.2", + "html-webpack-plugin": "3.2.0", + "husky": "1.3.1", + "lint-staged": "8.1.5", + "mockjs": "1.0.1-beta3", + "plop": "2.3.0", + "runjs": "^4.3.2", + "sass": "^1.26.10", + "sass-loader": "^7.1.0", + "script-ext-html-webpack-plugin": "2.1.3", + "serve-static": "^1.13.2", + "svg-sprite-loader": "4.1.3", + "svgo": "1.2.0", + "vue-template-compiler": "2.6.10" + }, + "engines": { + "node": ">=8.9", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions" + ] +} diff --git a/plop-templates/component/index.hbs b/plop-templates/component/index.hbs new file mode 100644 index 0000000..7661055 --- /dev/null +++ b/plop-templates/component/index.hbs @@ -0,0 +1,26 @@ +{{#if template}} + +{{/if}} + +{{#if script}} + +{{/if}} + +{{#if style}} + +{{/if}} diff --git a/plop-templates/component/prompt.js b/plop-templates/component/prompt.js new file mode 100644 index 0000000..3723e8e --- /dev/null +++ b/plop-templates/component/prompt.js @@ -0,0 +1,55 @@ +const { notEmpty } = require('../utils.js') + +module.exports = { + description: 'generate vue component', + prompts: [{ + type: 'input', + name: 'name', + message: 'component name please', + validate: notEmpty('name') + }, + { + type: 'checkbox', + name: 'blocks', + message: 'Blocks:', + choices: [{ + name: '