├── .eslintignore ├── generator ├── miniprogram │ ├── src │ │ ├── app.less │ │ ├── assets │ │ │ ├── img │ │ │ │ └── .gitkeep │ │ │ └── style │ │ │ │ ├── variables.less │ │ │ │ └── mixins.less │ │ ├── pages │ │ │ ├── index │ │ │ │ ├── index.less │ │ │ │ ├── index.config.ts │ │ │ │ └── index.vue │ │ │ └── webview │ │ │ │ ├── index.less │ │ │ │ ├── index.config.ts │ │ │ │ └── index.vue │ │ ├── services │ │ │ ├── RESTFULURL.ts │ │ │ ├── index.ts │ │ │ ├── autoMatchBaseUrl.ts │ │ │ └── request.ts │ │ ├── app.ts │ │ ├── app.config.ts │ │ ├── utils │ │ │ ├── globalData.ts │ │ │ ├── jump.ts │ │ │ ├── serialize.ts │ │ │ ├── log.ts │ │ │ └── index.ts │ │ ├── constants │ │ │ ├── constant.ts │ │ │ └── status.ts │ │ └── index.html │ ├── _browserslistrc │ ├── _gitignore │ ├── _eslintrc.js │ ├── config │ │ ├── dev.js │ │ └── prod.js │ ├── sitemap.json │ ├── _editorconfig │ ├── babel.config.js │ ├── global.d.ts │ ├── tsconfig.json │ └── project.config.json ├── template-base │ ├── src │ │ └── assets │ │ │ ├── js │ │ │ └── .gitkeep │ │ │ ├── img │ │ │ └── logo.png │ │ │ ├── fonts │ │ │ ├── iconfont.eot │ │ │ ├── iconfont.ttf │ │ │ ├── iconfont.woff │ │ │ ├── iconfont.css │ │ │ └── demo_fontclass.html │ │ │ └── style │ │ │ ├── app.less │ │ │ ├── main.less │ │ │ └── variable.less │ ├── _env.production │ ├── _prettierignore │ ├── _npmrc │ ├── _eslintignore │ ├── _yarnrc │ ├── _escheckrc │ ├── _browserslistrc │ ├── _husky │ │ ├── commit-msg │ │ ├── common.sh │ │ ├── pre-commit │ │ └── lintstagedrc.js │ ├── _stylelintignore │ ├── jsconfig.json │ ├── public │ │ ├── config.local.js │ │ └── console.js │ ├── stylelint.config.js │ ├── offlinePackage.json │ ├── webstorm.config.js │ ├── _editorconfig │ ├── _env.development │ ├── _ls-lint.yml │ ├── _gitignore │ ├── _eslintrc.js │ ├── build │ │ ├── package │ │ │ ├── variables.js │ │ │ └── see.js │ │ ├── index.js │ │ └── zip.js │ ├── babel.config.js │ ├── prettier.config.js │ ├── commitlint.config.js │ ├── tools │ │ └── init.js │ └── vite.config.js ├── template-vue2-ts │ ├── src │ │ ├── components │ │ │ └── .gitkeep │ │ ├── icons │ │ │ ├── components │ │ │ │ ├── index.ts │ │ │ │ ├── dog.ts │ │ │ │ └── cat.ts │ │ │ ├── index.ts │ │ │ ├── svg-icon.less │ │ │ └── svg │ │ │ │ ├── dog.svg │ │ │ │ └── cat.svg │ │ ├── services │ │ │ ├── RESTFULURL.ts │ │ │ ├── autoMatchBaseUrl.ts │ │ │ └── index.ts │ │ ├── interface │ │ │ └── DataValues.ts │ │ ├── shims-vue.d.ts │ │ ├── router │ │ │ ├── router.interceptor.ts │ │ │ └── index.ts │ │ ├── constant.ts │ │ ├── shims-tsx.d.ts │ │ ├── filters │ │ │ └── index.ts │ │ ├── views │ │ │ └── hello │ │ │ │ └── style.less │ │ ├── App.vue │ │ ├── pwa │ │ │ ├── service-worker.js │ │ │ ├── register-service-worker.ts │ │ │ └── components │ │ │ │ └── ServiceWorkerUpdatePopup.vue │ │ └── main.ts │ ├── public │ │ ├── robots.txt │ │ └── img │ │ │ └── icons │ │ │ ├── favicon-16x16.png │ │ │ ├── favicon-32x32.png │ │ │ ├── mstile-150x150.png │ │ │ ├── apple-touch-icon.png │ │ │ ├── android-chrome-192x192.png │ │ │ ├── android-chrome-512x512.png │ │ │ ├── apple-touch-icon-60x60.png │ │ │ ├── apple-touch-icon-76x76.png │ │ │ ├── apple-touch-icon-120x120.png │ │ │ ├── apple-touch-icon-152x152.png │ │ │ ├── apple-touch-icon-180x180.png │ │ │ └── msapplication-icon-144x144.png │ ├── types │ │ ├── vue-global.d.ts │ │ └── index.d.ts │ └── tsconfig.json ├── template-vue2-ts-vite │ ├── src │ │ ├── components │ │ │ └── .gitkeep │ │ ├── icons │ │ │ ├── components │ │ │ │ ├── index.ts │ │ │ │ ├── dog.ts │ │ │ │ └── cat.ts │ │ │ ├── index.ts │ │ │ ├── svg-icon.less │ │ │ └── svg │ │ │ │ ├── dog.svg │ │ │ │ └── cat.svg │ │ ├── services │ │ │ ├── RESTFULURL.ts │ │ │ ├── autoMatchBaseUrl.ts │ │ │ └── index.ts │ │ ├── interface │ │ │ └── DataValues.ts │ │ ├── shims-vue.d.ts │ │ ├── router │ │ │ ├── router.interceptor.ts │ │ │ └── index.ts │ │ ├── constant.ts │ │ ├── shims-tsx.d.ts │ │ ├── filters │ │ │ └── index.ts │ │ ├── views │ │ │ └── hello │ │ │ │ └── style.less │ │ ├── App.vue │ │ ├── pwa │ │ │ ├── service-worker.js │ │ │ ├── register-service-worker.ts │ │ │ └── components │ │ │ │ └── ServiceWorkerUpdatePopup.vue │ │ └── main.ts │ ├── public │ │ ├── robots.txt │ │ └── img │ │ │ └── icons │ │ │ ├── favicon-16x16.png │ │ │ ├── favicon-32x32.png │ │ │ ├── mstile-150x150.png │ │ │ ├── apple-touch-icon.png │ │ │ ├── android-chrome-192x192.png │ │ │ ├── android-chrome-512x512.png │ │ │ ├── apple-touch-icon-60x60.png │ │ │ ├── apple-touch-icon-76x76.png │ │ │ ├── apple-touch-icon-120x120.png │ │ │ ├── apple-touch-icon-152x152.png │ │ │ ├── apple-touch-icon-180x180.png │ │ │ └── msapplication-icon-144x144.png │ ├── types │ │ ├── vue-global.d.ts │ │ └── index.d.ts │ └── tsconfig.json ├── template-vue3-ts │ ├── public │ │ ├── robots.txt │ │ └── img │ │ │ └── icons │ │ │ ├── favicon-16x16.png │ │ │ ├── favicon-32x32.png │ │ │ ├── mstile-150x150.png │ │ │ ├── apple-touch-icon.png │ │ │ ├── android-chrome-192x192.png │ │ │ ├── android-chrome-512x512.png │ │ │ ├── apple-touch-icon-60x60.png │ │ │ ├── apple-touch-icon-76x76.png │ │ │ ├── apple-touch-icon-120x120.png │ │ │ ├── apple-touch-icon-152x152.png │ │ │ ├── apple-touch-icon-180x180.png │ │ │ └── msapplication-icon-144x144.png │ ├── src │ │ ├── services │ │ │ ├── RESTFULURL.ts │ │ │ ├── index.ts │ │ │ └── autoMatchBaseUrl.ts │ │ ├── interface │ │ │ └── DataValues.ts │ │ ├── useApp.ts │ │ ├── icons │ │ │ ├── index.ts │ │ │ └── svg │ │ │ │ ├── dog.svg │ │ │ │ └── cat.svg │ │ ├── shims-vue.d.ts │ │ ├── constant.ts │ │ ├── App.vue │ │ ├── router │ │ │ ├── router.interceptor.ts │ │ │ └── index.ts │ │ ├── views │ │ │ └── hello │ │ │ │ └── style.less │ │ ├── components │ │ │ └── global │ │ │ │ └── index.ts │ │ ├── pwa │ │ │ ├── service-worker.js │ │ │ └── register-service-worker.ts │ │ ├── shim-tsx.d.ts │ │ └── main.ts │ ├── types │ │ ├── index.d.ts │ │ ├── vue-global.d.ts │ │ └── window.d.ts │ └── tsconfig.json ├── template-vue2 │ └── src │ │ ├── services │ │ ├── RESTFULURL.js │ │ ├── autoMatchBaseUrl.js │ │ └── index.js │ │ ├── icons │ │ ├── components │ │ │ ├── index.js │ │ │ ├── dog.js │ │ │ └── cat.js │ │ ├── index.js │ │ ├── requireIcons.js │ │ ├── svg-icon.less │ │ └── svg │ │ │ ├── dog.svg │ │ │ └── cat.svg │ │ ├── components │ │ ├── index.js │ │ ├── global │ │ │ └── index.js │ │ └── SendCode │ │ │ └── index.vue │ │ ├── constant.js │ │ ├── App.vue │ │ ├── filters │ │ └── index.js │ │ ├── views │ │ ├── hello │ │ │ └── style.less │ │ └── svgIcons │ │ │ └── index.vue │ │ ├── router │ │ ├── router.interceptor.js │ │ └── index.js │ │ └── main.js ├── template-vue2-vite │ └── src │ │ ├── services │ │ ├── RESTFULURL.js │ │ ├── autoMatchBaseUrl.js │ │ └── index.js │ │ ├── icons │ │ ├── components │ │ │ ├── index.js │ │ │ ├── dog.js │ │ │ └── cat.js │ │ ├── index.js │ │ ├── svg-icon.less │ │ └── svg │ │ │ ├── dog.svg │ │ │ └── cat.svg │ │ ├── components │ │ ├── index.js │ │ └── SendCode │ │ │ └── index.vue │ │ ├── constant.js │ │ ├── App.vue │ │ ├── filters │ │ └── index.js │ │ ├── router │ │ ├── index.js │ │ └── router.interceptor.js │ │ ├── views │ │ └── hello │ │ │ └── style.less │ │ └── main.js ├── template-vue3 │ └── src │ │ ├── services │ │ ├── RESTFULURL.js │ │ ├── index.js │ │ └── autoMatchBaseUrl.js │ │ ├── router │ │ ├── router.interceptor.js │ │ └── index.js │ │ ├── useApp.js │ │ ├── components │ │ ├── index.js │ │ └── global │ │ │ └── index.js │ │ ├── icons │ │ ├── index.js │ │ └── svg │ │ │ ├── dog.svg │ │ │ └── cat.svg │ │ ├── App.vue │ │ ├── constant.js │ │ ├── views │ │ └── hello │ │ │ └── style.less │ │ └── main.js ├── subsystem │ ├── public │ │ └── frame │ │ │ ├── app.css.gz │ │ │ └── vendors_frame │ │ │ └── app.css.gz │ ├── src │ │ ├── utils │ │ │ └── index.js │ │ ├── locales │ │ │ ├── zh-CN.js │ │ │ ├── zh-TW.js │ │ │ ├── en-US.js │ │ │ └── index.js │ │ ├── components │ │ │ ├── index.js │ │ │ └── QuickNavigation │ │ │ │ └── index.vue │ │ ├── static │ │ │ └── js │ │ │ │ └── bizLogout.js │ │ ├── router │ │ │ └── index.js │ │ └── App.vue │ └── build │ │ ├── child │ │ └── config.child.js │ │ └── package │ │ └── see.child.js ├── hui.js ├── iview.js ├── element.js ├── ant.js ├── wui.js └── vant.js ├── .gitpod.yml ├── .prettierignore ├── docs ├── .vuepress │ ├── public │ │ └── favicon.ico │ └── config.js └── deploy.sh ├── ui ├── hui │ └── src │ │ └── vendor │ │ └── hui.js ├── iview │ └── src │ │ └── vendor │ │ └── iview.js ├── ant-design-vue │ └── src │ │ └── vendor │ │ └── ant.js ├── element │ └── src │ │ └── vendor │ │ └── element.js ├── ant-design-vue-v3 │ └── src │ │ └── vendor │ │ └── ant.js ├── element-v3 │ └── src │ │ └── vendor │ │ └── element.js ├── vant │ └── src │ │ └── vendor │ │ └── vant.js ├── vant-ts │ └── src │ │ └── vendor │ │ └── vant.ts ├── wui-ts │ └── src │ │ └── vendor │ │ └── wui.ts ├── wui │ └── src │ │ └── vendor │ │ └── wui.js ├── vant-v3 │ └── src │ │ └── vendor │ │ └── vant.js └── vant-ts-v3 │ └── src │ └── vendor │ └── vant.ts ├── .prettierrc ├── .eslintrc.js ├── preset.json ├── .gitignore ├── .editorconfig ├── package.json └── README.md /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /generator/miniprogram/src/app.less: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /generator/miniprogram/src/assets/img/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /generator/miniprogram/src/pages/index/index.less: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /generator/template-base/src/assets/js/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | tasks: 2 | - init: yarn install 3 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/components/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/components/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /generator/template-base/_env.production: -------------------------------------------------------------------------------- 1 | VUE_APP_BASE_API = '/api' 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | **/*.svg 2 | package.json 3 | output.js 4 | generator/ 5 | -------------------------------------------------------------------------------- /generator/template-base/_prettierignore: -------------------------------------------------------------------------------- 1 | **/*.svg 2 | package.json 3 | output.js -------------------------------------------------------------------------------- /generator/template-vue2-ts/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /generator/miniprogram/src/assets/style/variables.less: -------------------------------------------------------------------------------- 1 | @primaryColor: #2bacff; 2 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /generator/miniprogram/_browserslistrc: -------------------------------------------------------------------------------- 1 | last 3 versions 2 | iOS >= 9 3 | Android >= 4.1 4 | -------------------------------------------------------------------------------- /generator/miniprogram/src/pages/webview/index.less: -------------------------------------------------------------------------------- 1 | .webview { 2 | height: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /generator/template-vue2/src/services/RESTFULURL.js: -------------------------------------------------------------------------------- 1 | export default { 2 | octocat: 'octocat' 3 | }; 4 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/services/RESTFULURL.js: -------------------------------------------------------------------------------- 1 | export default { 2 | octocat: 'octocat' 3 | }; 4 | -------------------------------------------------------------------------------- /generator/miniprogram/src/pages/index/index.config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: '首页' 3 | }; 4 | -------------------------------------------------------------------------------- /generator/template-vue2/src/icons/components/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import './cat'; 3 | import './dog'; 4 | -------------------------------------------------------------------------------- /docs/.vuepress/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/docs/.vuepress/public/favicon.ico -------------------------------------------------------------------------------- /generator/miniprogram/_gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | deploy_versions/ 3 | .temp/ 4 | .rn_temp/ 5 | node_modules/ 6 | .DS_Store 7 | -------------------------------------------------------------------------------- /generator/miniprogram/src/pages/webview/index.config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | navigationBarTitleText: 'webview' 3 | }; 4 | -------------------------------------------------------------------------------- /generator/template-base/_npmrc: -------------------------------------------------------------------------------- 1 | registry=http://artifactory.hundsun.com/artifactory/api/npm/winnerproject-npm-virtual/ 2 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/icons/components/index.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | import './cat'; 3 | import './dog'; 4 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/icons/components/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import './cat'; 3 | import './dog'; 4 | -------------------------------------------------------------------------------- /generator/miniprogram/src/services/RESTFULURL.ts: -------------------------------------------------------------------------------- 1 | // 这里只保留接口名,不能包含路径 2 | export default { 3 | octocat: 'octocat' 4 | }; 5 | -------------------------------------------------------------------------------- /generator/template-base/_eslintignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /dist/ 3 | node_modules 4 | /public/ 5 | RESTFULURL.js 6 | /src/assets/ 7 | -------------------------------------------------------------------------------- /generator/template-base/_yarnrc: -------------------------------------------------------------------------------- 1 | registry "http://artifactory.hundsun.com/artifactory/api/npm/winnerproject-npm-virtual/" 2 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/icons/components/index.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | import './cat'; 3 | import './dog'; 4 | -------------------------------------------------------------------------------- /generator/template-vue3/src/services/RESTFULURL.js: -------------------------------------------------------------------------------- 1 | // 这里只保留接口名,不能包含路径 2 | export default { 3 | octocat: 'octocat' 4 | }; 5 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/services/RESTFULURL.ts: -------------------------------------------------------------------------------- 1 | // 这里只保留接口名,不能包含路径 2 | export default { 3 | octocat: 'octocat' 4 | }; 5 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/services/RESTFULURL.ts: -------------------------------------------------------------------------------- 1 | // 这里只保留接口名,不能包含路径 2 | export default { 3 | octocat: 'octocat' 4 | }; 5 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/services/RESTFULURL.ts: -------------------------------------------------------------------------------- 1 | // 这里只保留接口名,不能包含路径 2 | export default { 3 | octocat: 'octocat' 4 | }; 5 | -------------------------------------------------------------------------------- /generator/subsystem/public/frame/app.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/subsystem/public/frame/app.css.gz -------------------------------------------------------------------------------- /ui/hui/src/vendor/hui.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Hui from 'h_ui'; 3 | import 'h_ui/dist/h_ui.min.css'; 4 | 5 | Vue.use(Hui); 6 | -------------------------------------------------------------------------------- /generator/template-base/_escheckrc: -------------------------------------------------------------------------------- 1 | { 2 | "ecmaVersion": "es5", 3 | "module": false, 4 | "files": "./dist/**/*.js", 5 | "not": [] 6 | } 7 | -------------------------------------------------------------------------------- /generator/template-base/src/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-base/src/assets/img/logo.png -------------------------------------------------------------------------------- /ui/iview/src/vendor/iview.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import iView from 'iview'; 3 | import 'iview/dist/styles/iview.css'; 4 | 5 | Vue.use(iView); 6 | -------------------------------------------------------------------------------- /generator/template-base/_browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | Chrome > 43 5 | ff > 34 6 | ie >= 10 7 | iOS >= 9 8 | Android >= 5.0 9 | -------------------------------------------------------------------------------- /generator/template-base/src/assets/fonts/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-base/src/assets/fonts/iconfont.eot -------------------------------------------------------------------------------- /generator/template-base/src/assets/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-base/src/assets/fonts/iconfont.ttf -------------------------------------------------------------------------------- /generator/template-vue3/src/router/router.interceptor.js: -------------------------------------------------------------------------------- 1 | import router from './index'; 2 | 3 | router.beforeEach((to, from, next) => { 4 | next(); 5 | }); 6 | -------------------------------------------------------------------------------- /ui/ant-design-vue/src/vendor/ant.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Antd from 'ant-design-vue'; 3 | import 'ant-design-vue/dist/antd.css'; 4 | 5 | Vue.use(Antd); -------------------------------------------------------------------------------- /generator/template-base/src/assets/fonts/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-base/src/assets/fonts/iconfont.woff -------------------------------------------------------------------------------- /generator/subsystem/public/frame/vendors_frame/app.css.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/subsystem/public/frame/vendors_frame/app.css.gz -------------------------------------------------------------------------------- /generator/template-vue3/src/useApp.js: -------------------------------------------------------------------------------- 1 | let app; 2 | export function setApp(_app) { 3 | app = _app; 4 | } 5 | 6 | export function getApp() { 7 | return app; 8 | } 9 | -------------------------------------------------------------------------------- /generator/subsystem/src/utils/index.js: -------------------------------------------------------------------------------- 1 | // 检测是否是财富中台外框架 2 | export function checkIsHwsContainer() { 3 | return window.fetch && typeof window.fetch.post === 'function'; 4 | } 5 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/public/img/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts/public/img/icons/favicon-16x16.png -------------------------------------------------------------------------------- /generator/template-vue2-ts/public/img/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts/public/img/icons/favicon-32x32.png -------------------------------------------------------------------------------- /generator/template-vue3-ts/public/img/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue3-ts/public/img/icons/favicon-16x16.png -------------------------------------------------------------------------------- /generator/template-vue3-ts/public/img/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue3-ts/public/img/icons/favicon-32x32.png -------------------------------------------------------------------------------- /generator/template-base/_husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # shellcheck source=./_/husky.sh 4 | . "$(dirname "$0")/_/husky.sh" 5 | 6 | npx --no-install commitlint --edit "$1" 7 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/public/img/icons/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts/public/img/icons/mstile-150x150.png -------------------------------------------------------------------------------- /generator/template-vue3-ts/public/img/icons/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue3-ts/public/img/icons/mstile-150x150.png -------------------------------------------------------------------------------- /generator/template-base/_stylelintignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.png 3 | *.eot 4 | *.ttf 5 | *.woff 6 | 7 | /src/assets/fonts/ 8 | /dist/ 9 | /public/ 10 | /src/components/FrameLayout 11 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/public/img/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts-vite/public/img/icons/favicon-16x16.png -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/public/img/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts-vite/public/img/icons/favicon-32x32.png -------------------------------------------------------------------------------- /generator/template-vue2-ts/public/img/icons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts/public/img/icons/apple-touch-icon.png -------------------------------------------------------------------------------- /generator/template-vue3-ts/public/img/icons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue3-ts/public/img/icons/apple-touch-icon.png -------------------------------------------------------------------------------- /generator/miniprogram/_eslintrc.js: -------------------------------------------------------------------------------- 1 | // ESLint 检查 .vue 文件需要单独配置编辑器: 2 | // https://eslint.vuejs.org/user-guide/#editor-integrations 3 | module.exports = { 4 | extends: ['taro/vue'] 5 | }; 6 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/public/img/icons/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts-vite/public/img/icons/mstile-150x150.png -------------------------------------------------------------------------------- /generator/template-vue3-ts/types/index.d.ts: -------------------------------------------------------------------------------- 1 | // @winner-fed/cloud-utils -> webpack alias utils 2 | declare module 'utils'; 3 | 4 | declare module '*.png'; 5 | 6 | declare module '*.gif'; 7 | -------------------------------------------------------------------------------- /ui/element/src/vendor/element.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Element from 'element-ui'; 3 | import 'element-ui/lib/theme-chalk/index.css'; 4 | 5 | Vue.use(Element, {size: 'small'}); 6 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/public/img/icons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts-vite/public/img/icons/apple-touch-icon.png -------------------------------------------------------------------------------- /generator/template-vue2-ts/public/img/icons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts/public/img/icons/android-chrome-192x192.png -------------------------------------------------------------------------------- /generator/template-vue2-ts/public/img/icons/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts/public/img/icons/android-chrome-512x512.png -------------------------------------------------------------------------------- /generator/template-vue2-ts/public/img/icons/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts/public/img/icons/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /generator/template-vue2-ts/public/img/icons/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts/public/img/icons/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /generator/template-vue3-ts/public/img/icons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue3-ts/public/img/icons/android-chrome-192x192.png -------------------------------------------------------------------------------- /generator/template-vue3-ts/public/img/icons/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue3-ts/public/img/icons/android-chrome-512x512.png -------------------------------------------------------------------------------- /generator/template-vue3-ts/public/img/icons/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue3-ts/public/img/icons/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /generator/template-vue3-ts/public/img/icons/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue3-ts/public/img/icons/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /generator/template-vue2-ts/public/img/icons/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts/public/img/icons/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /generator/template-vue2-ts/public/img/icons/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts/public/img/icons/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /generator/template-vue2-ts/public/img/icons/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts/public/img/icons/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /generator/template-vue2/src/components/index.js: -------------------------------------------------------------------------------- 1 | // tree shaking 2 | import SendCode from './SendCode'; 3 | import NetworkBroken from './NetworkBroken'; 4 | 5 | export { SendCode, NetworkBroken }; 6 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/public/img/icons/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue3-ts/public/img/icons/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /generator/template-vue3-ts/public/img/icons/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue3-ts/public/img/icons/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /generator/template-vue3-ts/public/img/icons/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue3-ts/public/img/icons/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /generator/template-vue3/src/components/index.js: -------------------------------------------------------------------------------- 1 | // tree shaking 2 | import SendCode from './SendCode'; 3 | import NetworkBroken from './NetworkBroken'; 4 | 5 | export { SendCode, NetworkBroken }; 6 | -------------------------------------------------------------------------------- /ui/ant-design-vue-v3/src/vendor/ant.js: -------------------------------------------------------------------------------- 1 | import Antd from 'ant-design-vue'; 2 | import 'ant-design-vue/dist/antd.css'; 3 | 4 | export default function setupVendor(app) { 5 | app.use(Antd); 6 | } 7 | -------------------------------------------------------------------------------- /generator/subsystem/src/locales/zh-CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | m: { 3 | i: { 4 | locale: 'zh-CN', 5 | demo: { 6 | title: '菜单标题' 7 | } 8 | } 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /generator/subsystem/src/locales/zh-TW.js: -------------------------------------------------------------------------------- 1 | export default { 2 | m: { 3 | i: { 4 | locale: 'zh-TW', 5 | demo: { 6 | title: '菜單標題' 7 | } 8 | } 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/public/img/icons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts-vite/public/img/icons/android-chrome-192x192.png -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/public/img/icons/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts-vite/public/img/icons/android-chrome-512x512.png -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/public/img/icons/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts-vite/public/img/icons/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/public/img/icons/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts-vite/public/img/icons/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /generator/template-vue2-ts/public/img/icons/msapplication-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts/public/img/icons/msapplication-icon-144x144.png -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/components/index.js: -------------------------------------------------------------------------------- 1 | // tree shaking 2 | import SendCode from './SendCode'; 3 | import NetworkBroken from './NetworkBroken'; 4 | 5 | export { SendCode, NetworkBroken }; 6 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/public/img/icons/msapplication-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue3-ts/public/img/icons/msapplication-icon-144x144.png -------------------------------------------------------------------------------- /ui/element-v3/src/vendor/element.js: -------------------------------------------------------------------------------- 1 | import ElementPlus from 'element-plus'; 2 | import 'element-plus/dist/index.css'; 3 | 4 | export default function setupVendor (app) { 5 | app.use(ElementPlus); 6 | } 7 | -------------------------------------------------------------------------------- /generator/subsystem/src/locales/en-US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | m: { 3 | i: { 4 | locale: 'en-US', 5 | demo: { 6 | title: 'menu title' 7 | } 8 | } 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/public/img/icons/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts-vite/public/img/icons/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/public/img/icons/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts-vite/public/img/icons/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/public/img/icons/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts-vite/public/img/icons/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /ui/vant/src/vendor/vant.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import { Button } from 'vant'; 3 | 4 | // 这种使用方法,只是保证了 vant 本身的按需引用,但是针对各个页面,并没有做到。 5 | // 如果需要针对各个页面做,则需要各个页面独立引用 6 | // 按需引用 7 | Vue 8 | .use(Button); 9 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/public/img/icons/msapplication-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cklwblove/vue-preset/HEAD/generator/template-vue2-ts-vite/public/img/icons/msapplication-icon-144x144.png -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/interface/DataValues.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 定义接口类 3 | * 最佳实践 -> 接口名字一般建议 I 开头,便于别人阅读 4 | */ 5 | 6 | export interface DataValues { 7 | year: string; 8 | value: number; 9 | } 10 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/interface/DataValues.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 定义接口类 3 | * 最佳实践 -> 接口名字一般建议 I 开头,便于别人阅读 4 | */ 5 | 6 | export interface DataValues { 7 | year: string; 8 | value: number; 9 | } 10 | -------------------------------------------------------------------------------- /ui/vant-ts/src/vendor/vant.ts: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import { Button } from 'vant'; 3 | 4 | // 这种使用方法,只是保证了 vant 本身的按需引用,但是针对各个页面,并没有做到。 5 | // 如果需要针对各个页面做,则需要各个页面独立引用 6 | // 按需引用 7 | Vue 8 | .use(Button); 9 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/interface/DataValues.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 定义接口类 3 | * 最佳实践 -> 接口名字一般建议 I 开头,便于别人阅读 4 | */ 5 | 6 | export interface DataValues { 7 | year: string; 8 | value: number; 9 | } 10 | -------------------------------------------------------------------------------- /ui/wui-ts/src/vendor/wui.ts: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import { Button } from '@winner-fed/win-ui'; 3 | 4 | // 这种使用方法,只是保证了 wui 本身的按需引用,但是针对各个页面,并没有做到。 5 | // 如果需要针对各个页面做,则需要各个页面独立引用 6 | // 按需引用 7 | Vue 8 | .use(Button); 9 | -------------------------------------------------------------------------------- /ui/wui/src/vendor/wui.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import { Button } from '@winner-fed/win-ui'; 3 | 4 | // 这种使用方法,只是保证了 wui 本身的按需引用,但是针对各个页面,并没有做到。 5 | // 如果需要针对各个页面做,则需要各个页面独立引用 6 | // 按需引用 7 | Vue 8 | .use(Button); 9 | -------------------------------------------------------------------------------- /generator/miniprogram/config/dev.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | NODE_ENV: '"development"' 4 | }, 5 | defineConstants: {}, 6 | mini: {}, 7 | h5: { 8 | esnextModules: ['taro-ui-vue'] 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/types/vue-global.d.ts: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | 3 | declare module 'vue/types/vue' { 4 | // 可以使用 `VueConstructor` 接口 5 | // 来声明全局属性 6 | interface Vue { 7 | $services: any; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/types/vue-global.d.ts: -------------------------------------------------------------------------------- 1 | // TODO 不能删除,删除就报错 2 | import { createApp } from 'vue'; 3 | 4 | declare module '@vue/runtime-core' { 5 | interface ComponentCustomProperties { 6 | $services: any; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /generator/subsystem/src/locales/index.js: -------------------------------------------------------------------------------- 1 | import zhCN from './zh-CN'; 2 | import zhTW from './zh-TW'; 3 | import enUs from './en-US'; 4 | 5 | export default { 6 | 'zh-CN': zhCN, 7 | 'zh-TW': zhTW, 8 | 'en-US': enUs 9 | }; 10 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/types/vue-global.d.ts: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | 3 | declare module 'vue/types/vue' { 4 | // 可以使用 `VueConstructor` 接口 5 | // 来声明全局属性 6 | interface Vue { 7 | $services: any; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import Vue from 'vue'; 3 | export default Vue; 4 | } 5 | 6 | declare module '*.svg' { 7 | import Vue from 'vue'; 8 | export default Vue; 9 | } 10 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import Vue from 'vue'; 3 | export default Vue; 4 | } 5 | 6 | declare module '*.svg' { 7 | import Vue from 'vue'; 8 | export default Vue; 9 | } 10 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/useApp.ts: -------------------------------------------------------------------------------- 1 | import type { App } from 'vue'; 2 | 3 | let app: App; 4 | export function setApp(_app: App): void { 5 | app = _app; 6 | } 7 | 8 | export function getApp(): App { 9 | return app; 10 | } 11 | -------------------------------------------------------------------------------- /ui/vant-v3/src/vendor/vant.js: -------------------------------------------------------------------------------- 1 | import { Button } from 'vant'; 2 | 3 | export default function setupVendor (app) { 4 | // 这种使用方法,只是保证了 vant 本身的按需引用,但是针对各个页面,并没有做到。 5 | // 如果需要针对各个页面做,则需要各个页面独立引用 6 | // 按需引用 7 | app.use(Button); 8 | } 9 | -------------------------------------------------------------------------------- /generator/template-base/src/assets/style/app.less: -------------------------------------------------------------------------------- 1 | @import "./variable"; 2 | @import "@winner-fed/magicless/magicless.less"; 3 | @import (less) "normalize.css"; 4 | @import "./reset"; 5 | @import (less) "../fonts/iconfont.css"; 6 | @import "./main"; 7 | -------------------------------------------------------------------------------- /generator/miniprogram/sitemap.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", 3 | "rules": [ 4 | { 5 | "action": "allow", 6 | "page": "*" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /generator/template-base/_husky/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | command_exists () { 3 | command -v "$1" >/dev/null 2>&1 4 | } 5 | 6 | # Workaround for Windows 10, Git Bash and Yarn 7 | if command_exists winpty && test -t 1; then 8 | exec < /dev/tty 9 | fi 10 | -------------------------------------------------------------------------------- /ui/vant-ts-v3/src/vendor/vant.ts: -------------------------------------------------------------------------------- 1 | import { Button } from 'vant'; 2 | 3 | export default function setupVendor(app) { 4 | // 这种使用方法,只是保证了 vant 本身的按需引用,但是针对各个页面,并没有做到。 5 | // 如果需要针对各个页面做,则需要各个页面独立引用 6 | // 按需引用 7 | app 8 | .use(Button); 9 | } 10 | -------------------------------------------------------------------------------- /generator/template-base/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "./", 4 | "paths": { 5 | "@/*": [ 6 | "src/*" 7 | ] 8 | } 9 | }, 10 | "exclude": [ 11 | "node_modules", 12 | "dist" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/types/window.d.ts: -------------------------------------------------------------------------------- 1 | import type { App } from 'vue'; 2 | 3 | declare global { 4 | declare interface Window { 5 | __APP__: App; 6 | LOCAL_CONFIG?: any; 7 | LightSDK?: any; 8 | $eventBus?: any; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/icons/index.ts: -------------------------------------------------------------------------------- 1 | import { VueSvgIconPlugin } from '@yzfe/vue3-svgicon'; 2 | import '@yzfe/svgicon/lib/svgicon.css'; 3 | 4 | export default function setSvgIcon(app) { 5 | app.use(VueSvgIconPlugin, { 6 | tagName: 'svg-icon' 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /generator/template-vue3/src/icons/index.js: -------------------------------------------------------------------------------- 1 | import { VueSvgIconPlugin } from '@yzfe/vue3-svgicon'; 2 | import '@yzfe/svgicon/lib/svgicon.css'; 3 | 4 | export default function setSvgIcon(app) { 5 | app.use(VueSvgIconPlugin, { 6 | tagName: 'svg-icon' 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "useTabs": false, 4 | "tabWidth": 2, 5 | "singleQuote": true, 6 | "trailingComma": "none", 7 | "proseWrap": "never", 8 | "arrowParens": "always", 9 | "vueIndentScriptAndStyle": true, 10 | "endOfLine": "lf" 11 | } 12 | -------------------------------------------------------------------------------- /generator/template-base/public/config.local.js: -------------------------------------------------------------------------------- 1 | window.LOCAL_CONFIG = { 2 | API_HOME: 'https://api.github.com/', 3 | API_UPLOAD: 'https://api.github.com/upload'<%_ if (options.application !== 'pc') { _%>, 4 | // vconsole 开关 5 | IS_OPEN_VCONSOLE: true 6 | <%_ } _%> 7 | } 8 | -------------------------------------------------------------------------------- /generator/miniprogram/_editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /generator/template-vue2/src/icons/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import SvgIcon from 'vue-svgicon'; 3 | import './svg-icon.less'; 4 | import './components'; 5 | 6 | Vue.use(SvgIcon, { 7 | tagName: 'svg-icon', 8 | defaultWidth: '1em', 9 | defaultHeight: '1em' 10 | }); 11 | -------------------------------------------------------------------------------- /generator/miniprogram/src/app.ts: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import './app.less'; 3 | 4 | const App = { 5 | onShow(options) {}, 6 | render(h) { 7 | // this.$slots.default 是将要会渲染的页面 8 | return h('block', this.$slots.default); 9 | } 10 | }; 11 | 12 | export default App; 13 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/icons/index.ts: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import SvgIcon from 'vue-svgicon'; 3 | import './svg-icon.less'; 4 | import './components'; 5 | 6 | Vue.use(SvgIcon, { 7 | tagName: 'svg-icon', 8 | defaultWidth: '1em', 9 | defaultHeight: '1em' 10 | }); 11 | -------------------------------------------------------------------------------- /generator/miniprogram/src/app.config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | pages: ['pages/index/index'], 3 | window: { 4 | backgroundTextStyle: 'light', 5 | navigationBarBackgroundColor: '#fff', 6 | navigationBarTitleText: 'WeChat', 7 | navigationBarTextStyle: 'black' 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /generator/template-base/_husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | . "$(dirname "$0")/common.sh" 4 | 5 | [ -n "$CI" ] && exit 0 6 | 7 | # Format and submit code according to lintstagedrc.js configuration 8 | npm run lint:lint-staged 9 | 10 | npm run lint:pretty 11 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/icons/index.ts: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import SvgIcon from 'vue-svgicon'; 3 | import './svg-icon.less'; 4 | import './components'; 5 | 6 | Vue.use(SvgIcon, { 7 | tagName: 'svg-icon', 8 | defaultWidth: '1em', 9 | defaultHeight: '1em' 10 | }); 11 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/types/index.d.ts: -------------------------------------------------------------------------------- 1 | interface Window { 2 | LOCAL_CONFIG?: any; 3 | LightSDK?: any; 4 | $eventBus?: any; 5 | } 6 | 7 | // @winner-fed/cloud-utils -> webpack alias utils 8 | declare module 'utils'; 9 | 10 | declare module '*.png'; 11 | 12 | declare module '*.gif'; 13 | -------------------------------------------------------------------------------- /generator/hui.js: -------------------------------------------------------------------------------- 1 | module.exports = (api, options, rootOptions) => { 2 | api.extendPackage({ 3 | dependencies: { 4 | h_ui: '*' 5 | } 6 | }); 7 | api.render('../ui/hui'); 8 | api.injectImports('src/vendor/index.js', `import './hui.js'`); 9 | api.onCreateComplete(() => {}); 10 | }; 11 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/types/index.d.ts: -------------------------------------------------------------------------------- 1 | interface Window { 2 | LOCAL_CONFIG?: any; 3 | LightSDK?: any; 4 | $eventBus?: any; 5 | } 6 | 7 | // @winner-fed/cloud-utils -> webpack alias utils 8 | declare module 'utils'; 9 | 10 | declare module '*.png'; 11 | 12 | declare module '*.gif'; 13 | -------------------------------------------------------------------------------- /generator/iview.js: -------------------------------------------------------------------------------- 1 | module.exports = (api, options, rootOptions) => { 2 | api.extendPackage({ 3 | dependencies: { 4 | iview: '^3.4.1' 5 | } 6 | }); 7 | api.render('../ui/iview'); 8 | api.injectImports('src/vendor/index.js', `import './iview.js'`); 9 | api.onCreateComplete(() => {}); 10 | }; 11 | -------------------------------------------------------------------------------- /generator/subsystem/src/components/index.js: -------------------------------------------------------------------------------- 1 | // tree shaking 2 | import SendCode from './SendCode'; 3 | import NetworkBroken from './NetworkBroken'; 4 | import QuickNavigation from './QuickNavigation'; 5 | import FrameLayout from './FrameLayout'; 6 | 7 | export { SendCode, NetworkBroken, QuickNavigation, FrameLayout }; 8 | -------------------------------------------------------------------------------- /generator/template-base/stylelint.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (you@example.org) 4 | * @date 2020-08-03 19:13 5 | * @version stylelint 配置 6 | */ 7 | // https://stylelint.docschina.org/user-guide/rules/ 8 | module.exports = { 9 | root: true, 10 | extends: '@winner-fed/stylelint-config-win' 11 | }; 12 | -------------------------------------------------------------------------------- /generator/miniprogram/babel.config.js: -------------------------------------------------------------------------------- 1 | // babel-preset-taro 更多选项和默认值: 2 | // https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md 3 | module.exports = { 4 | presets: [ 5 | [ 6 | 'taro', 7 | { 8 | framework: 'vue', 9 | ts: true 10 | } 11 | ] 12 | ] 13 | }; 14 | -------------------------------------------------------------------------------- /generator/miniprogram/src/services/index.ts: -------------------------------------------------------------------------------- 1 | import request from './request'; 2 | import urls from './RESTFULURL'; 3 | 4 | let FUNS = {}; 5 | 6 | Object.keys(urls).forEach((key) => { 7 | FUNS[key] = (options = {}) => { 8 | return request.safeRequest(urls[key], options); 9 | }; 10 | }); 11 | 12 | export default FUNS; 13 | -------------------------------------------------------------------------------- /generator/template-vue2/src/icons/requireIcons.js: -------------------------------------------------------------------------------- 1 | const req = require.context('./svg', false, /\.svg$/); 2 | const requireAll = (requireContext) => requireContext.keys(); 3 | 4 | const re = /\.\/(.*)\.svg/; 5 | 6 | const icons = requireAll(req).map((i) => { 7 | return i.match(re)[1]; 8 | }); 9 | 10 | export default icons; 11 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/icons/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import SvgIcon from 'vue-svgicon'; 3 | import './svg-icon.less'; 4 | import './components'; 5 | 6 | Vue.use(SvgIcon, { 7 | tagName: 'svg-icon', 8 | defaultWidth: '1em', 9 | defaultHeight: '1em' 10 | }); 11 | 12 | // 使用示例 13 | // 14 | -------------------------------------------------------------------------------- /generator/subsystem/src/static/js/bizLogout.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 业务登入登出扩展逻辑 3 | */ 4 | // eslint-disable-next-line no-undef 5 | define(function () { 6 | return { 7 | bizLogout: function () { 8 | console.log('此处为业务登出代码'); 9 | }, 10 | bizLogin: function (psw) { 11 | console.log('此处为业务登入代码', psw); 12 | } 13 | }; 14 | }); 15 | -------------------------------------------------------------------------------- /generator/template-vue3/src/App.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | parser: "babel-eslint", 7 | parserOptions: { 8 | sourceType: "module", 9 | allowImportExportEverywhere: true 10 | }, 11 | extends: "standard", 12 | rules: { 13 | indent: ["error", 2], 14 | "no-unused-vars": "off" 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/router/router.interceptor.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2019/01/12 5 | * @description 定义路由拦截器模块,比如登录鉴权逻辑等 6 | */ 7 | import { Route } from 'vue-router'; 8 | import router from './index'; 9 | 10 | router.beforeEach((to: Route, from: Route, next: any) => { 11 | next(); 12 | }); 13 | -------------------------------------------------------------------------------- /docs/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 确保脚本抛出遇到的错误 4 | set -e 5 | 6 | # 生成静态文件 7 | npm run docs:build 8 | 9 | # 进入生成的文件夹 10 | cd docs/.vuepress/dist 11 | 12 | git init 13 | git add -A 14 | git commit -m 'deploy' 15 | 16 | # 如果发布到 https://.github.io/ 17 | git push -f git@github.com:cklwblove/vue-preset.git master:gh-pages 18 | 19 | cd - -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/router/router.interceptor.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2019/01/12 5 | * @description 定义路由拦截器模块,比如登录鉴权逻辑等 6 | */ 7 | import { Route } from 'vue-router'; 8 | import router from './index'; 9 | 10 | router.beforeEach((to: Route, from: Route, next: any) => { 11 | next(); 12 | }); 13 | -------------------------------------------------------------------------------- /generator/template-vue2/src/constant.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2018/6/5 上午10:43 5 | * @description 定义项目所需常量 6 | */ 7 | 8 | const TIMEOUT = 25000; 9 | const PAGE_NUM = 15; 10 | const UPLOAD_PREFIX = 'upload/'; 11 | const HOME_PREFIX = 'home/'; 12 | 13 | export { TIMEOUT, PAGE_NUM, UPLOAD_PREFIX, HOME_PREFIX }; 14 | -------------------------------------------------------------------------------- /generator/template-vue3/src/constant.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2018/6/5 上午10:43 5 | * @description 定义项目所需常量 6 | */ 7 | 8 | const TIMEOUT = 25000; 9 | const PAGE_NUM = 15; 10 | const UPLOAD_PREFIX = 'upload/'; 11 | const HOME_PREFIX = 'home/'; 12 | 13 | export { TIMEOUT, PAGE_NUM, UPLOAD_PREFIX, HOME_PREFIX }; 14 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/constant.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2018/6/5 上午10:43 5 | * @description 定义项目所需常量 6 | */ 7 | 8 | const TIMEOUT = 25000; 9 | const PAGE_NUM = 15; 10 | const UPLOAD_PREFIX = 'upload/'; 11 | const HOME_PREFIX = 'home/'; 12 | 13 | export { TIMEOUT, PAGE_NUM, UPLOAD_PREFIX, HOME_PREFIX }; 14 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import type { DefineComponent } from 'vue'; 3 | const component: DefineComponent; 4 | export default component; 5 | } 6 | 7 | declare module '*.svg' { 8 | import type { DefineComponent } from 'vue'; 9 | const component: DefineComponent; 10 | export default component; 11 | } 12 | -------------------------------------------------------------------------------- /preset.json: -------------------------------------------------------------------------------- 1 | { 2 | "useConfigFiles": true, 3 | "packageManager": "yarn", 4 | "useTaobaoRegistry": true, 5 | "cssPreprocessor": "less", 6 | "router": false, 7 | "vuex": false, 8 | "routerHistoryMode": false, 9 | "plugins": { 10 | "@vue/cli-plugin-babel": {}, 11 | "vue-cli-plugin-qrcode": { 12 | "version": "*" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | 4 | docs/.vuepress/dist/ 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | 15 | # Editor directories and files 16 | .idea 17 | .vscode 18 | .history 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw* 24 | 25 | yarn.lock 26 | -------------------------------------------------------------------------------- /generator/template-base/offlinePackage.json: -------------------------------------------------------------------------------- 1 | { 2 | "//id": "离线包的 ID", 3 | "id": "<%= options['offline-id'] %>", 4 | 5 | "//name": "离线包的中文描述", 6 | "name": "<%= options['offline-name'] %>", 7 | 8 | "//appVersion": "需要依赖的安卓或者IOS APP 版本,可以是具体的版本,如 6.0.0.0,也可以是一个区间,如 0.0.0.0~9.9.9.9", 9 | "appVersion": { 10 | "ios": "6.0.0.0", 11 | "android": "6.0.0.0" 12 | } 13 | } -------------------------------------------------------------------------------- /generator/template-base/webstorm.config.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | // 以一个文件的方式使用解析好的配置 3 | // https://cli.vuejs.org/zh/guide/webpack.html#%E4%BB%A5%E4%B8%80%E4%B8%AA%E6%96%87%E4%BB%B6%E7%9A%84%E6%96%B9%E5%BC%8F%E4%BD%BF%E7%94%A8%E8%A7%A3%E6%9E%90%E5%A5%BD%E7%9A%84%E9%85%8D%E7%BD%AE 4 | 5 | const webpackConfig = require('@vue/cli-service/webpack.config.js'); 6 | module.exports = webpackConfig; 7 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/constant.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2018/6/5 上午10:43 5 | * @description 定义项目所需常量 6 | */ 7 | 8 | const TIMEOUT: number = 25000; 9 | const PAGE_NUM: number = 15; 10 | const UPLOAD_PREFIX: string = 'upload/'; 11 | const HOME_PREFIX: string = 'home/'; 12 | 13 | export { TIMEOUT, PAGE_NUM, UPLOAD_PREFIX, HOME_PREFIX }; 14 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/App.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | -------------------------------------------------------------------------------- /generator/template-vue2/src/App.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/constant.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2018/6/5 上午10:43 5 | * @description 定义项目所需常量 6 | */ 7 | 8 | const TIMEOUT: number = 25000; 9 | const PAGE_NUM: number = 15; 10 | const UPLOAD_PREFIX: string = 'upload/'; 11 | const HOME_PREFIX: string = 'home/'; 12 | 13 | export { TIMEOUT, PAGE_NUM, UPLOAD_PREFIX, HOME_PREFIX }; 14 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/constant.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2018/6/5 上午10:43 5 | * @description 定义项目所需常量 6 | */ 7 | 8 | const TIMEOUT: number = 25000; 9 | const PAGE_NUM: number = 15; 10 | const UPLOAD_PREFIX: string = 'upload/'; 11 | const HOME_PREFIX: string = 'home/'; 12 | 13 | export { TIMEOUT, PAGE_NUM, UPLOAD_PREFIX, HOME_PREFIX }; 14 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/shims-tsx.d.ts: -------------------------------------------------------------------------------- 1 | import Vue, { VNode } from 'vue'; 2 | 3 | declare global { 4 | namespace JSX { 5 | // tslint:disable no-empty-interface 6 | interface Element extends VNode {} 7 | // tslint:disable no-empty-interface 8 | interface ElementClass extends Vue {} 9 | interface IntrinsicElements { 10 | [elem: string]: any; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/shims-tsx.d.ts: -------------------------------------------------------------------------------- 1 | import Vue, { VNode } from 'vue'; 2 | 3 | declare global { 4 | namespace JSX { 5 | // tslint:disable no-empty-interface 6 | interface Element extends VNode {} 7 | // tslint:disable no-empty-interface 8 | interface ElementClass extends Vue {} 9 | interface IntrinsicElements { 10 | [elem: string]: any; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/.vuepress/config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | base: '/vue-preset/', 3 | serviceWorker: true, 4 | title: 'vue-preset 说明文档', 5 | head: [ 6 | ['link', { rel: 'icon', href: './favicon.ico' }] 7 | ], 8 | themeConfig: { 9 | sidebar: 'auto', 10 | repo: 'https://github.com/cklwblove/vue-preset', 11 | docsDir: 'docs', 12 | serviceWorker: { 13 | updatePopup: true 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /generator/miniprogram/src/services/autoMatchBaseUrl.ts: -------------------------------------------------------------------------------- 1 | import { combineURLs } from '@winner-fed/cloud-utils/dist/cloud-utils.esm.js'; 2 | import { BASE_URL } from '@/constants/constant'; 3 | 4 | /** 5 | * 根据前缀,自动匹配基础的url 6 | * 根据项目所需,自己扩展 7 | * @param prefix 8 | * @returns {string} 9 | */ 10 | export default function autoMatchBaseUrl(prefix: string = '') { 11 | 12 | return combineURLs(BASE_URL, prefix); 13 | } 14 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/App.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 17 | -------------------------------------------------------------------------------- /generator/miniprogram/src/utils/globalData.ts: -------------------------------------------------------------------------------- 1 | const globalData = {}; 2 | 3 | if (IS_RN) { 4 | global.globalData = {}; 5 | } 6 | 7 | const setGlobalData = (key: string, val: any) => { 8 | (IS_RN ? global.globalData : globalData)[key] = val; 9 | }; 10 | 11 | const getGlobalData = (key: string) => { 12 | return (IS_RN ? global.globalData : globalData)[key]; 13 | }; 14 | 15 | export { setGlobalData, getGlobalData }; 16 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/router/router.interceptor.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2019/01/12 5 | * @description 定义路由拦截器模块,比如登录鉴权逻辑等 6 | */ 7 | import { RouteLocationNormalized } from 'vue-router'; 8 | import router from './index'; 9 | 10 | router.beforeEach( 11 | (to: RouteLocationNormalized, from: RouteLocationNormalized, next: any) => { 12 | next(); 13 | } 14 | ); 15 | -------------------------------------------------------------------------------- /generator/template-vue3/src/services/index.js: -------------------------------------------------------------------------------- 1 | import request from './request'; 2 | import urls from './RESTFULURL'; 3 | 4 | const FUNS = {}; 5 | 6 | Object.keys(urls).forEach((key) => { 7 | FUNS[key] = (options = {}) => { 8 | return request(urls[key], options); 9 | }; 10 | }); 11 | 12 | export function setGlobalProperties(app) { 13 | app.config.globalProperties.$services = FUNS; 14 | } 15 | 16 | export default FUNS; 17 | -------------------------------------------------------------------------------- /generator/template-vue2/src/filters/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2018/6/5 上午10:43 5 | * @description 定义过滤器模块 6 | */ 7 | 8 | import Vue from 'vue'; 9 | import { formatDate } from 'utils'; 10 | 11 | // register global utility filters. 12 | export const filters = { 13 | formatDate 14 | }; 15 | 16 | Object.keys(filters).forEach((key) => { 17 | Vue.filter(key, filters[key]); 18 | }); 19 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/services/index.ts: -------------------------------------------------------------------------------- 1 | import request from './request'; 2 | import urls from './RESTFULURL'; 3 | 4 | const FUNS = {}; 5 | 6 | Object.keys(urls).forEach((key) => { 7 | FUNS[key] = (options = {}) => { 8 | return request(urls[key], options); 9 | }; 10 | }); 11 | 12 | export function setGlobalProperties(app) { 13 | app.config.globalProperties.$services = FUNS; 14 | } 15 | 16 | export default FUNS; 17 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/filters/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2018/6/5 上午10:43 5 | * @description 定义过滤器模块 6 | */ 7 | 8 | import Vue from 'vue'; 9 | import { formatDate } from 'utils'; 10 | 11 | // register global utility filters. 12 | export const filters = { 13 | formatDate 14 | }; 15 | 16 | Object.keys(filters).forEach((key) => { 17 | Vue.filter(key, filters[key]); 18 | }); 19 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/filters/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2018/6/5 上午10:43 5 | * @description 定义过滤器模块 6 | */ 7 | 8 | import Vue from 'vue'; 9 | 10 | import { formatDate } from 'utils'; 11 | 12 | // register global utility filters. 13 | export const filters = { 14 | formatDate 15 | }; 16 | 17 | Object.keys(filters).forEach((key) => { 18 | Vue.filter(key, filters[key]); 19 | }); 20 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/filters/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2018/6/5 上午10:43 5 | * @description 定义过滤器模块 6 | */ 7 | 8 | import Vue from 'vue'; 9 | 10 | import { formatDate } from 'utils'; 11 | 12 | // register global utility filters. 13 | export const filters = { 14 | formatDate 15 | }; 16 | 17 | Object.keys(filters).forEach((key) => { 18 | Vue.filter(key, filters[key]); 19 | }); 20 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset=utf-8 6 | end_of_line=lf 7 | insert_final_newline=true 8 | trim_trailing_whitespace=true 9 | indent_style=space 10 | indent_size=2 11 | 12 | [{.eslintrc,.babelrc,.stylelintrc,*.json}] 13 | indent_style=space 14 | indent_size=2 15 | 16 | [*.less] 17 | indent_style=space 18 | indent_size=2 19 | 20 | [*.{js,jsx,ts,tsx,vue}] 21 | indent_style=space 22 | indent_size=2 23 | 24 | -------------------------------------------------------------------------------- /generator/miniprogram/src/constants/constant.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2018/6/5 上午10:43 5 | * @description 定义项目所需常量 6 | */ 7 | 8 | const TIMEOUT: number = 25000; 9 | const PAGE_NUM: number = 15; 10 | const UPLOAD_PREFIX: string = 'upload/'; 11 | const HOME_PREFIX: string = 'home/'; 12 | const BASE_URL: string = 'https://api.github.com/users'; 13 | 14 | export { TIMEOUT, PAGE_NUM, UPLOAD_PREFIX, HOME_PREFIX, BASE_URL }; 15 | -------------------------------------------------------------------------------- /generator/template-base/_husky/lintstagedrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'src/**/*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'], 3 | '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': ['prettier --write--parser json'], 4 | 'package.json': ['prettier --write'], 5 | 'src/**/*.vue': ['eslint --fix', 'prettier --write', 'stylelint --fix'], 6 | 'src/**/*.{scss,less,styl,html}': ['stylelint --fix', 'prettier --write'], 7 | '*.md': ['prettier --write'] 8 | }; 9 | -------------------------------------------------------------------------------- /generator/template-base/_editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset=utf-8 6 | end_of_line=lf 7 | insert_final_newline=true 8 | trim_trailing_whitespace=true 9 | indent_style=space 10 | indent_size=2 11 | 12 | [{.eslintrc,.babelrc,.stylelintrc,*.json}] 13 | indent_style=space 14 | indent_size=2 15 | 16 | [*.less] 17 | indent_style=space 18 | indent_size=2 19 | 20 | [*.{js,jsx,ts,tsx,vue}] 21 | indent_style=space 22 | indent_size=2 23 | 24 | -------------------------------------------------------------------------------- /generator/template-vue2/src/components/global/index.js: -------------------------------------------------------------------------------- 1 | // 这里放置需要全局注册的组件 2 | import Vue from 'vue'; 3 | 4 | // 自动加载 global 目录下的 .vue 结尾的文件 5 | const componentsContext = require.context('./', true, /\.vue$/); 6 | 7 | componentsContext.keys().forEach((component) => { 8 | const componentConfig = componentsContext(component); 9 | // 兼容 import export 和 require module.export 两种规范 10 | const ctrl = componentConfig.default || componentConfig; 11 | Vue.component(ctrl.name, ctrl); 12 | }); 13 | -------------------------------------------------------------------------------- /generator/template-vue2/src/services/autoMatchBaseUrl.js: -------------------------------------------------------------------------------- 1 | import { UPLOAD_PREFIX } from '@/constant'; 2 | 3 | /** 4 | * 根据前缀,自动匹配基础的url 5 | * 根据项目所需,自己扩展 6 | * @param prefix 7 | * @returns {string} 8 | */ 9 | export default function autoMatchBaseUrl(prefix = '') { 10 | let baseUrl = ''; 11 | if (prefix === UPLOAD_PREFIX) { 12 | baseUrl = window.LOCAL_CONFIG.API_UPLOAD; 13 | } else { 14 | baseUrl = window.LOCAL_CONFIG.API_HOME; 15 | } 16 | 17 | return baseUrl; 18 | } 19 | -------------------------------------------------------------------------------- /generator/template-vue3/src/services/autoMatchBaseUrl.js: -------------------------------------------------------------------------------- 1 | import { UPLOAD_PREFIX } from '@/constant'; 2 | 3 | /** 4 | * 根据前缀,自动匹配基础的url 5 | * 根据项目所需,自己扩展 6 | * @param prefix 7 | * @returns {string} 8 | */ 9 | export default function autoMatchBaseUrl(prefix = '') { 10 | let baseUrl = ''; 11 | if (prefix === UPLOAD_PREFIX) { 12 | baseUrl = window.LOCAL_CONFIG.API_UPLOAD; 13 | } else { 14 | baseUrl = window.LOCAL_CONFIG.API_HOME; 15 | } 16 | 17 | return baseUrl; 18 | } 19 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/services/autoMatchBaseUrl.js: -------------------------------------------------------------------------------- 1 | import { UPLOAD_PREFIX } from '@/constant'; 2 | 3 | /** 4 | * 根据前缀,自动匹配基础的url 5 | * 根据项目所需,自己扩展 6 | * @param prefix 7 | * @returns {string} 8 | */ 9 | export default function autoMatchBaseUrl(prefix = '') { 10 | let baseUrl = ''; 11 | if (prefix === UPLOAD_PREFIX) { 12 | baseUrl = window.LOCAL_CONFIG.API_UPLOAD; 13 | } else { 14 | baseUrl = window.LOCAL_CONFIG.API_HOME; 15 | } 16 | 17 | return baseUrl; 18 | } 19 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/views/hello/style.less: -------------------------------------------------------------------------------- 1 | .page-hello { 2 | font-family: Avenir, Helvetica, Arial, sans-serif; 3 | -webkit-font-smoothing: antialiased; 4 | -moz-osx-font-smoothing: grayscale; 5 | color: #2c3e50; 6 | text-align: center; 7 | 8 | .demo { 9 | width: 790px; 10 | padding-top: 25px; 11 | margin: 0 auto; 12 | text-align: left; 13 | } 14 | 15 | h3 { 16 | padding-left: 25px; 17 | } 18 | 19 | img { 20 | margin: 0 auto; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/views/hello/style.less: -------------------------------------------------------------------------------- 1 | .page-hello { 2 | font-family: Avenir, Helvetica, Arial, sans-serif; 3 | -webkit-font-smoothing: antialiased; 4 | -moz-osx-font-smoothing: grayscale; 5 | color: #2c3e50; 6 | text-align: center; 7 | 8 | .demo { 9 | width: 790px; 10 | padding-top: 25px; 11 | margin: 0 auto; 12 | text-align: left; 13 | } 14 | 15 | h3 { 16 | padding-left: 25px; 17 | } 18 | 19 | img { 20 | margin: 0 auto; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/views/hello/style.less: -------------------------------------------------------------------------------- 1 | .page-hello { 2 | font-family: Avenir, Helvetica, Arial, sans-serif; 3 | -webkit-font-smoothing: antialiased; 4 | -moz-osx-font-smoothing: grayscale; 5 | color: #2c3e50; 6 | text-align: center; 7 | 8 | .demo { 9 | width: 790px; 10 | padding-top: 25px; 11 | margin: 0 auto; 12 | text-align: left; 13 | } 14 | 15 | h3 { 16 | padding-left: 25px; 17 | } 18 | 19 | img { 20 | margin: 0 auto; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/services/autoMatchBaseUrl.ts: -------------------------------------------------------------------------------- 1 | import { UPLOAD_PREFIX } from '@/constant'; 2 | 3 | /** 4 | * 根据前缀,自动匹配基础的url 5 | * 根据项目所需,自己扩展 6 | * @param prefix 7 | * @returns {string} 8 | */ 9 | export default function autoMatchBaseUrl(prefix: string = '') { 10 | let baseUrl = ''; 11 | if (prefix === UPLOAD_PREFIX) { 12 | baseUrl = window.LOCAL_CONFIG.API_UPLOAD; 13 | } else { 14 | baseUrl = window.LOCAL_CONFIG.API_HOME; 15 | } 16 | 17 | return baseUrl; 18 | } 19 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/services/autoMatchBaseUrl.ts: -------------------------------------------------------------------------------- 1 | import { UPLOAD_PREFIX } from '@/constant'; 2 | 3 | /** 4 | * 根据前缀,自动匹配基础的url 5 | * 根据项目所需,自己扩展 6 | * @param prefix 7 | * @returns {string} 8 | */ 9 | export default function autoMatchBaseUrl(prefix: string = '') { 10 | let baseUrl = ''; 11 | if (prefix === UPLOAD_PREFIX) { 12 | baseUrl = window.LOCAL_CONFIG.API_UPLOAD; 13 | } else { 14 | baseUrl = window.LOCAL_CONFIG.API_HOME; 15 | } 16 | 17 | return baseUrl; 18 | } 19 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/services/autoMatchBaseUrl.ts: -------------------------------------------------------------------------------- 1 | import { UPLOAD_PREFIX } from '@/constant'; 2 | 3 | /** 4 | * 根据前缀,自动匹配基础的url 5 | * 根据项目所需,自己扩展 6 | * @param prefix 7 | * @returns {string} 8 | */ 9 | export default function autoMatchBaseUrl(prefix: string = '') { 10 | let baseUrl = ''; 11 | if (prefix === UPLOAD_PREFIX) { 12 | baseUrl = window.LOCAL_CONFIG.API_UPLOAD; 13 | } else { 14 | baseUrl = window.LOCAL_CONFIG.API_HOME; 15 | } 16 | 17 | return baseUrl; 18 | } 19 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | Vue.use(Router); 4 | export const routes = [ 5 | { 6 | component: () => import('@/views/hello/index.vue'), 7 | name: 'hello', 8 | path: '/hello', 9 | meta: { 10 | title: '首页' 11 | } 12 | }, 13 | { 14 | path: '/', 15 | redirect: '/hello' 16 | } 17 | ]; 18 | const router = new Router({ 19 | mode: 'hash', 20 | routes 21 | }); 22 | export default router; 23 | -------------------------------------------------------------------------------- /generator/template-vue2/src/views/hello/style.less: -------------------------------------------------------------------------------- 1 | .page-hello { 2 | font-family: Avenir, Helvetica, Arial, sans-serif; 3 | -webkit-font-smoothing: antialiased; 4 | -moz-osx-font-smoothing: grayscale; 5 | color: #2c3e50; 6 | text-align: center; 7 | 8 | .demo { 9 | width: 790px; 10 | padding-top: 25px; 11 | margin: 0 auto; 12 | text-align: left; 13 | } 14 | 15 | h3 { 16 | padding-left: 25px; 17 | color: #000; 18 | } 19 | 20 | img { 21 | margin: 0 auto; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /generator/template-vue3/src/views/hello/style.less: -------------------------------------------------------------------------------- 1 | .page-hello { 2 | font-family: Avenir, Helvetica, Arial, sans-serif; 3 | -webkit-font-smoothing: antialiased; 4 | -moz-osx-font-smoothing: grayscale; 5 | color: #2c3e50; 6 | text-align: center; 7 | 8 | .demo { 9 | width: 790px; 10 | padding-top: 25px; 11 | margin: 0 auto; 12 | text-align: left; 13 | } 14 | 15 | h3 { 16 | padding-left: 25px; 17 | color: #000; 18 | } 19 | 20 | img { 21 | margin: 0 auto; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/views/hello/style.less: -------------------------------------------------------------------------------- 1 | .page-hello { 2 | font-family: Avenir, Helvetica, Arial, sans-serif; 3 | -webkit-font-smoothing: antialiased; 4 | -moz-osx-font-smoothing: grayscale; 5 | color: #2c3e50; 6 | text-align: center; 7 | 8 | .demo { 9 | width: 790px; 10 | padding-top: 25px; 11 | margin: 0 auto; 12 | text-align: left; 13 | } 14 | 15 | h3 { 16 | padding-left: 25px; 17 | color: #000; 18 | } 19 | 20 | img { 21 | margin: 0 auto; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/services/index.ts: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import request from './request'; 3 | import urls from './RESTFULURL'; 4 | 5 | const FUNS = {}; 6 | 7 | Object.keys(urls).forEach((key) => { 8 | FUNS[key] = (options = {}) => { 9 | return request(urls[key], options); 10 | }; 11 | }); 12 | 13 | // 将services挂载到vue的原型上 14 | // views引用的方法:this.$services.接口名(小驼峰) 15 | Object.defineProperty(Vue.prototype, '$services', { 16 | get () { 17 | return FUNS; 18 | } 19 | }); 20 | 21 | export default FUNS; 22 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/services/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import request from './request'; 3 | import urls from './RESTFULURL'; 4 | 5 | const FUNS = {}; 6 | 7 | Object.keys(urls).forEach((key) => { 8 | FUNS[key] = (options = {}) => { 9 | return request(urls[key], options); 10 | }; 11 | }); 12 | 13 | // 将services挂载到vue的原型上 14 | // views引用的方法:this.$services.接口名(小驼峰) 15 | Object.defineProperty(Vue.prototype, '$services', { 16 | get () { 17 | return FUNS; 18 | } 19 | }); 20 | 21 | export default FUNS; 22 | -------------------------------------------------------------------------------- /generator/subsystem/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | Vue.use(Router); 4 | // 路由需采用平铺,不要使用嵌套路由 5 | export const routes = [ 6 | { 7 | component: () => import(/* webpackChunkName: "views/hello" */ `@/views/hello/index.vue`), 8 | name: 'hello', 9 | path: '/hello', 10 | meta: { 11 | title: '首页' 12 | } 13 | }, 14 | { 15 | path: '/', 16 | redirect: '/hello' 17 | } 18 | ]; 19 | const router = new Router({ mode: 'hash', routes }); 20 | export default router; 21 | -------------------------------------------------------------------------------- /generator/template-base/_env.development: -------------------------------------------------------------------------------- 1 | VUE_APP_BASE_API = '/api' 2 | 3 | // With this configuration, vue-cli uses babel-plugin-dynamic-import-node 4 | // It only does one thing by converting all import() to require() 5 | // So that all asynchronous components can be import synchronously using this plugin 6 | // This configuration can significantly increase the speed of hot updates when you have a large number of pages 7 | // https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js 8 | VUE_CLI_BABEL_TRANSPILE_MODULES = true 9 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/services/index.ts: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import request from './request'; 3 | import urls from './RESTFULURL'; 4 | 5 | const FUNS = {}; 6 | 7 | Object.keys(urls).forEach((key) => { 8 | FUNS[key] = (options = {}) => { 9 | return request(urls[key], options); 10 | }; 11 | }); 12 | 13 | // 将services挂载到vue的原型上 14 | // views引用的方法:this.$services.接口名(小驼峰) 15 | Object.defineProperty(Vue.prototype, '$services', { 16 | get () { 17 | return FUNS; 18 | } 19 | }); 20 | 21 | export default FUNS; 22 | -------------------------------------------------------------------------------- /generator/template-vue2/src/services/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import request from './request'; 3 | import urls from './RESTFULURL'; 4 | 5 | const FUNS = {}; 6 | 7 | Object.keys(urls).forEach((key) => { 8 | FUNS[key] = (options = {}) => { 9 | return request(urls[key], options); 10 | }; 11 | }); 12 | 13 | // 将services挂载到vue的原型上 14 | // views引用的方法:this.$services.接口名(小驼峰) 15 | // 防止被篡改 16 | Object.defineProperty(Vue.prototype, '$services', { 17 | get () { 18 | return FUNS; 19 | } 20 | }); 21 | 22 | export default FUNS; 23 | -------------------------------------------------------------------------------- /generator/template-vue2/src/router/router.interceptor.js: -------------------------------------------------------------------------------- 1 | import router from './index'; 2 | <%_ if (options.application === 'offline') { _%> 3 | import { isLightOS, navigateTo } from '@winner-fed/native-bridge-methods'; 4 | <%_ } _%> 5 | 6 | router.beforeEach((to, from, next) => { 7 | <%_ if (options.application === 'offline') { _%> 8 | if (from.name && isLightOS()) { 9 | navigateTo({url: `${window.location.href.split('#')[0]}#${to.fullPath}`}) 10 | } else { 11 | next(); 12 | } 13 | <%_ } else { _%> 14 | next(); 15 | <%_ } _%> 16 | }); 17 | -------------------------------------------------------------------------------- /generator/element.js: -------------------------------------------------------------------------------- 1 | module.exports = (api, options, rootOptions) => { 2 | if (options.preset === 'v2') { 3 | api.extendPackage({ 4 | dependencies: { 5 | 'element-ui': '^2.15.6' 6 | } 7 | }); 8 | } else { 9 | api.extendPackage({ 10 | dependencies: { 11 | 'element-plus': '^1.1.0-beta.24' 12 | } 13 | }); 14 | } 15 | if (options.preset === 'v2') { 16 | api.render('../ui/element'); 17 | } else { 18 | api.render('../ui/element-v3'); 19 | } 20 | api.onCreateComplete(() => {}); 21 | }; 22 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/router/router.interceptor.js: -------------------------------------------------------------------------------- 1 | import router from './index'; 2 | <%_ if (options.application === 'offline') { _%> 3 | import { isLightOS, navigateTo } from '@winner-fed/native-bridge-methods'; 4 | <%_ } _%> 5 | 6 | router.beforeEach((to, from, next) => { 7 | <%_ if (options.application === 'offline') { _%> 8 | if (from.name && isLightOS()) { 9 | navigateTo({url: `${window.location.href.split('#')[0]}#${to.fullPath}`}) 10 | } else { 11 | next(); 12 | } 13 | <%_ } else { _%> 14 | next(); 15 | <%_ } _%> 16 | }); 17 | -------------------------------------------------------------------------------- /generator/template-base/_ls-lint.yml: -------------------------------------------------------------------------------- 1 | ls: 2 | src/*: 3 | .js: kebab-case | PascalCase 4 | .vue: PascalCase | regex:^index 5 | .ts: camelCase | PascalCase 6 | .tsx: camelCase | PascalCase 7 | .d.ts: kebab-case 8 | .mock.ts: kebab-case 9 | .data.ts: camelCase | kebab-case 10 | .test-d.ts: kebab-case 11 | .less: kebab-case | PascalCase 12 | .spec.ts: camelCase | PascalCase 13 | 14 | ignore: 15 | - node_modules 16 | - .git 17 | - .circleci 18 | - .github 19 | - .vscode 20 | - .idea 21 | - dist 22 | - .local 23 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/components/global/index.ts: -------------------------------------------------------------------------------- 1 | // 这里放置需要全局注册的组件 2 | import { getApp } from '@/useApp'; 3 | 4 | // 自动加载 global 目录下的 .vue 结尾的文件 5 | const componentsContext = require.context('./', true, /\.vue$/); 6 | 7 | export function registerGlobComp() { 8 | componentsContext.keys().forEach((component) => { 9 | const componentConfig = componentsContext(component); 10 | // 兼容 import export 和 require module.export 两种规范 11 | const ctrl = componentConfig.default || componentConfig; 12 | getApp().component(ctrl.name, ctrl); 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /generator/template-vue3/src/components/global/index.js: -------------------------------------------------------------------------------- 1 | // 这里放置需要全局注册的组件 2 | import { getApp } from '@/useApp'; 3 | 4 | // 自动加载 global 目录下的 .vue 结尾的文件 5 | const componentsContext = require.context('./', true, /\.vue$/); 6 | 7 | export function registerGlobComp() { 8 | componentsContext.keys().forEach((component) => { 9 | const componentConfig = componentsContext(component); 10 | // 兼容 import export 和 require module.export 两种规范 11 | const ctrl = componentConfig.default || componentConfig; 12 | getApp().component(ctrl.name, ctrl); 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /generator/template-vue3/src/router/index.js: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHashHistory } from 'vue-router'; 2 | 3 | export const routes = [ 4 | { 5 | component: () => import('@/views/hello/index.vue'), 6 | name: 'hello', 7 | path: '/hello', 8 | meta: { 9 | title: '首页' 10 | } 11 | }, 12 | { 13 | path: '/', 14 | redirect: '/hello' 15 | } 16 | ]; 17 | 18 | const router = createRouter({ 19 | history: createWebHashHistory(), 20 | routes 21 | }); 22 | 23 | export function setupRouter(app) { 24 | app.use(router); 25 | } 26 | 27 | export default router; 28 | -------------------------------------------------------------------------------- /generator/miniprogram/src/pages/webview/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 25 | -------------------------------------------------------------------------------- /generator/template-base/_gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | 23 | # Optional npm cache directory 24 | .npm 25 | 26 | # Optional eslint cache 27 | .eslintcache 28 | 29 | # Optional REPL history 30 | .node_repl_history 31 | 32 | # Output of 'npm pack' 33 | *.tgz 34 | 35 | .project 36 | .happypack 37 | .history 38 | yarn.lock 39 | 40 | /package 41 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/icons/svg-icon.less: -------------------------------------------------------------------------------- 1 | /* recommended css code for vue-svgicon */ 2 | .svg-icon { 3 | display: inline-block; 4 | width: 16px; 5 | height: 16px; 6 | color: inherit; 7 | vertical-align: middle; 8 | fill: none; 9 | stroke: currentColor; 10 | } 11 | 12 | .svg-fill { 13 | fill: currentColor; 14 | stroke: none; 15 | } 16 | 17 | .svg-up { 18 | /* default */ 19 | transform: rotate(0deg); 20 | } 21 | 22 | .svg-right { 23 | transform: rotate(90deg); 24 | } 25 | 26 | .svg-down { 27 | transform: rotate(180deg); 28 | } 29 | 30 | .svg-left { 31 | transform: rotate(-90deg); 32 | } 33 | -------------------------------------------------------------------------------- /generator/template-vue2/src/icons/svg-icon.less: -------------------------------------------------------------------------------- 1 | /* recommended css code for vue-svgicon */ 2 | .svg-icon { 3 | display: inline-block; 4 | width: 16px; 5 | height: 16px; 6 | color: inherit; 7 | vertical-align: middle; 8 | fill: none; 9 | stroke: currentColor; 10 | } 11 | 12 | .svg-fill { 13 | fill: currentColor; 14 | stroke: none; 15 | } 16 | 17 | .svg-up { 18 | /* default */ 19 | transform: rotate(0deg); 20 | } 21 | 22 | .svg-right { 23 | transform: rotate(90deg); 24 | } 25 | 26 | .svg-down { 27 | transform: rotate(180deg); 28 | } 29 | 30 | .svg-left { 31 | transform: rotate(-90deg); 32 | } 33 | -------------------------------------------------------------------------------- /generator/ant.js: -------------------------------------------------------------------------------- 1 | module.exports = (api, options, rootOptions) => { 2 | if (options.preset === 'v2') { 3 | api.extendPackage({ 4 | dependencies: { 5 | 'ant-design-vue': '^1.3.8' 6 | } 7 | }); 8 | } else { 9 | api.extendPackage({ 10 | dependencies: { 11 | 'ant-design-vue': '^2.2.8' 12 | } 13 | }); 14 | } 15 | if (options.preset === 'v2') { 16 | api.render('../ui/ant-design-vue'); 17 | } else { 18 | api.render('../ui/ant-design-vue-v3'); 19 | } 20 | api.injectImports('src/vendor/index.js', `import './ant.js'`); 21 | api.onCreateComplete(() => {}); 22 | }; 23 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/icons/svg-icon.less: -------------------------------------------------------------------------------- 1 | /* recommended css code for vue-svgicon */ 2 | .svg-icon { 3 | display: inline-block; 4 | width: 16px; 5 | height: 16px; 6 | color: inherit; 7 | vertical-align: middle; 8 | fill: none; 9 | stroke: currentColor; 10 | } 11 | 12 | .svg-fill { 13 | fill: currentColor; 14 | stroke: none; 15 | } 16 | 17 | .svg-up { 18 | /* default */ 19 | transform: rotate(0deg); 20 | } 21 | 22 | .svg-right { 23 | transform: rotate(90deg); 24 | } 25 | 26 | .svg-down { 27 | transform: rotate(180deg); 28 | } 29 | 30 | .svg-left { 31 | transform: rotate(-90deg); 32 | } 33 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/icons/svg-icon.less: -------------------------------------------------------------------------------- 1 | /* recommended css code for vue-svgicon */ 2 | .svg-icon { 3 | display: inline-block; 4 | width: 16px; 5 | height: 16px; 6 | color: inherit; 7 | vertical-align: middle; 8 | fill: none; 9 | stroke: currentColor; 10 | } 11 | 12 | .svg-fill { 13 | fill: currentColor; 14 | stroke: none; 15 | } 16 | 17 | .svg-up { 18 | /* default */ 19 | transform: rotate(0deg); 20 | } 21 | 22 | .svg-right { 23 | transform: rotate(90deg); 24 | } 25 | 26 | .svg-down { 27 | transform: rotate(180deg); 28 | } 29 | 30 | .svg-left { 31 | transform: rotate(-90deg); 32 | } 33 | -------------------------------------------------------------------------------- /generator/template-vue2/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | Vue.use(Router); 4 | export const routes = [{ 5 | component: () => import('@/views/hello/index.vue'), 6 | name: 'hello', 7 | path: '/hello', 8 | meta: { 9 | title: '首页' 10 | } 11 | }, 12 | { 13 | component: () => import('@/views/svgIcons/index.vue'), 14 | name: 'svgIcons', 15 | path: '/svgIcons', 16 | }, 17 | { 18 | path: '/', 19 | redirect: '/hello' 20 | }, 21 | ]; 22 | const router = new Router({ 23 | mode: 'hash', 24 | routes, 25 | }); 26 | export default router; 27 | -------------------------------------------------------------------------------- /generator/template-base/_eslintrc.js: -------------------------------------------------------------------------------- 1 | // http://eslint.org/docs/user-guide/configuring 2 | // http://eslint.cn/docs/user-guide/configuring 中文 3 | 4 | module.exports = { 5 | extends: [ 6 | '@winner-fed/win', 7 | '@winner-fed/win/vue' 8 | ]<%_ if (options['language'] === 'ts') { _%>, 9 | parserOptions: { 10 | parser: '@typescript-eslint/parser', 11 | ecmaVersion: 2020 12 | }, 13 | rules: { 14 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 15 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', 16 | '@typescript-eslint/no-explicit-any': 'off' 17 | }<%_ } _%> 18 | }; 19 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/router/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2019/01/12 5 | * @description 定义路由模块 6 | */ 7 | 8 | import Vue from 'vue'; 9 | import Router, { RouteConfig } from 'vue-router'; 10 | import Hello from '@/views/hello/index.vue'; 11 | 12 | Vue.use(Router); 13 | 14 | const routes: RouteConfig[] = [ 15 | { 16 | path: '/', 17 | name: 'hello', 18 | component: Hello, 19 | meta: { 20 | title: '首页' 21 | } 22 | }, 23 | { 24 | path: '*', 25 | redirect: '/' 26 | } 27 | ]; 28 | 29 | export default new Router({ 30 | mode: 'hash', 31 | routes 32 | }); 33 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/router/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2019/01/12 5 | * @description 定义路由模块 6 | */ 7 | 8 | import Vue from 'vue'; 9 | import Router, { RouteConfig } from 'vue-router'; 10 | import Hello from '@/views/hello/index.vue'; 11 | 12 | Vue.use(Router); 13 | 14 | const routes: RouteConfig[] = [ 15 | { 16 | path: '/', 17 | name: 'hello', 18 | component: Hello, 19 | meta: { 20 | title: '首页' 21 | } 22 | }, 23 | { 24 | path: '*', 25 | redirect: '/' 26 | } 27 | ]; 28 | 29 | export default new Router({ 30 | mode: 'hash', 31 | routes 32 | }); 33 | -------------------------------------------------------------------------------- /generator/miniprogram/config/prod.js: -------------------------------------------------------------------------------- 1 | const TerserPlugin = require('terser-webpack-plugin'); 2 | 3 | module.exports = { 4 | env: { 5 | NODE_ENV: '"production"' 6 | }, 7 | defineConstants: {}, 8 | mini: {}, 9 | h5: { 10 | publicPath: './', 11 | webpackChain(chain) { 12 | // 阻止生成 *.license.txt 13 | chain.plugin('terser').use(TerserPlugin, [ 14 | { 15 | extractComments: false 16 | } 17 | ]); 18 | // 如果h5端编译后体积过大,可以使用webpack-bundle-analyzer插件对打包体积进行分析。 19 | // 参考代码如下: 20 | chain.plugin('analyzer').use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, []); 21 | } 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/App.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 24 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/App.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 24 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/pwa/service-worker.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | // This is the code piece that GenerateSW mode can't provide for us. 3 | // This code listens for the user's confirmation to update the app. 4 | self.addEventListener('message', (e) => { 5 | if (e.data) { 6 | if (e.data === 'skipWaiting') { 7 | self.skipWaiting(); 8 | } 9 | } 10 | }); 11 | 12 | workbox.clientsClaim(); 13 | 14 | // The precaching code provided by Workbox. You don't need to change this part. 15 | self.__precacheManifest = [].concat(self.__precacheManifest || []); 16 | workbox.precaching.suppressWarnings(); 17 | workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); 18 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/pwa/service-worker.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | // This is the code piece that GenerateSW mode can't provide for us. 3 | // This code listens for the user's confirmation to update the app. 4 | self.addEventListener('message', (e) => { 5 | if (e.data) { 6 | if (e.data === 'skipWaiting') { 7 | self.skipWaiting(); 8 | } 9 | } 10 | }); 11 | 12 | workbox.clientsClaim(); 13 | 14 | // The precaching code provided by Workbox. You don't need to change this part. 15 | self.__precacheManifest = [].concat(self.__precacheManifest || []); 16 | workbox.precaching.suppressWarnings(); 17 | workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); 18 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/pwa/service-worker.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | // This is the code piece that GenerateSW mode can't provide for us. 3 | // This code listens for the user's confirmation to update the app. 4 | self.addEventListener('message', (e) => { 5 | if (e.data) { 6 | if (e.data === 'skipWaiting') { 7 | self.skipWaiting(); 8 | } 9 | } 10 | }); 11 | 12 | workbox.clientsClaim(); 13 | 14 | // The precaching code provided by Workbox. You don't need to change this part. 15 | self.__precacheManifest = [].concat(self.__precacheManifest || []); 16 | workbox.precaching.suppressWarnings(); 17 | workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); 18 | -------------------------------------------------------------------------------- /generator/subsystem/build/child/config.child.js: -------------------------------------------------------------------------------- 1 | const base = require('./webpack.child.conf'); 2 | const merge = require('webpack-merge'); 3 | const builds = { 4 | prod: { 5 | filename: '[name].js', 6 | libraryTarget: 'umd', 7 | env: 'production' 8 | } 9 | }; 10 | 11 | function genConfig(opts) { 12 | return merge({}, base, { 13 | output: { 14 | filename: opts.filename, 15 | libraryTarget: opts.libraryTarget 16 | } 17 | }); 18 | } 19 | 20 | if (process.env.TARGET) { 21 | module.exports = genConfig(builds[process.env.TARGET]); 22 | } else { 23 | exports.getBuild = (name) => genConfig(builds[name]); 24 | exports.getAllBuilds = () => Object.keys(builds).map((name) => genConfig(builds[name])); 25 | } 26 | -------------------------------------------------------------------------------- /generator/template-base/build/package/variables.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (you@example.org) 4 | * @date 2022/01/04 11:33 5 | * @version variables 参考 http://hui.hundsun.com/frame-config/#see-variables 6 | */ 7 | 8 | module.exports = { 9 | variables: [ 10 | { 11 | type: 'input', 12 | label: '服务基础路径', 13 | name: 'API_HOME', 14 | required: true, 15 | tooltip: '后端服务接口地址', 16 | default: 'http://121.12.154.243:9080/h5-api-f/' 17 | }, 18 | { 19 | type: 'switch', 20 | label: '是否启用调试工具', 21 | name: 'IS_OPEN_VCONSOLE', 22 | options: 'true:是;false:否', 23 | required: false, 24 | tooltip: '是否启用调试工具 vconsole', 25 | default: 'true' 26 | } 27 | ] 28 | }; 29 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/router/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @authors liwb (lwbhtml@gmail.com) 4 | * @date 2020/10/14 5 | * @description 定义路由模块 6 | */ 7 | import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'; 8 | 9 | const routes: Array = [ 10 | { 11 | path: '/hello', 12 | name: 'hello', 13 | component: () => import('@views/hello/index.vue'), 14 | meta: { 15 | title: '首页' 16 | } 17 | }, 18 | { 19 | path: '/', 20 | redirect: '/hello' 21 | } 22 | ]; 23 | 24 | const router = createRouter({ 25 | history: createWebHashHistory(), 26 | routes 27 | }); 28 | 29 | export function setupRouter(app) { 30 | app.use(router); 31 | } 32 | 33 | export default router; 34 | -------------------------------------------------------------------------------- /generator/template-base/babel.config.js: -------------------------------------------------------------------------------- 1 | const plugins = []; 2 | 3 | <%_ if (options['language'] === 'js') { _%> 4 | <%_ if (options['mobile-ui-framework'] === 'vant') { _%> 5 | plugins.push( 6 | ['import', { 7 | libraryName: 'vant', 8 | libraryDirectory: 'es', 9 | style: true 10 | }, 'vant'] 11 | ); 12 | <%_ } _%> 13 | <%_ if (options['mobile-ui-framework'] === 'wui') { _%> 14 | plugins.push( 15 | ['import', { 16 | libraryName: '@winner-fed/win-ui', 17 | libraryDirectory: 'es', 18 | style: true 19 | }, '@winner-fed/win-ui'] 20 | ); 21 | <%_ } _%> 22 | <%_ } _%> 23 | 24 | module.exports = { 25 | presets: [ 26 | ['@vue/cli-plugin-babel/preset', 27 | { 28 | useBuiltIns: 'entry' 29 | } 30 | ] 31 | ], 32 | plugins 33 | }; 34 | -------------------------------------------------------------------------------- /generator/miniprogram/src/assets/style/mixins.less: -------------------------------------------------------------------------------- 1 | /** 2 | * 对于部分不兼容的样式,可以通过 mixins 统一处理 3 | */ 4 | /** 5 | * NOTE RN 无法通过 text-overflow 实现省略号,这些代码不能打包到 RN 中 6 | */ 7 | .text-ellipsis() { 8 | /*postcss-pxtransform rn eject enable*/ 9 | overflow: hidden; 10 | white-space: nowrap; 11 | text-overflow: ellipsis; 12 | /*postcss-pxtransform rn eject disable*/ 13 | } 14 | 15 | /** 16 | * NOTE 实现多行文本省略,RN 用 Text 标签的 numberOfLines,H5/小程序用 -webkit-line-clamp 17 | */ 18 | .lamp-clamp(@line) { 19 | /*postcss-pxtransform rn eject enable*/ 20 | overflow: hidden; 21 | text-overflow: ellipsis; 22 | display: -webkit-box; 23 | -webkit-line-clamp: @line; 24 | /* autoprefixer: ignore next */ 25 | -webkit-box-orient: vertical; 26 | /*postcss-pxtransform rn eject disable*/ 27 | } 28 | -------------------------------------------------------------------------------- /generator/template-base/src/assets/style/main.less: -------------------------------------------------------------------------------- 1 | .iconfont { 2 | position: relative; 3 | display: inline-block; 4 | vertical-align: middle; 5 | } 6 | 7 | .no-data { 8 | padding: 10px 0; 9 | font-size: 16px; 10 | color: #999; 11 | text-align: center; 12 | } 13 | 14 | .pages { 15 | position: relative; 16 | width: 100%; 17 | height: 100%; 18 | overflow: hidden; 19 | font-size: @fontSizeH3; 20 | } 21 | 22 | .page { 23 | position: absolute; 24 | top: 0; 25 | left: 0; 26 | width: 100%; 27 | height: 100%; 28 | transform: translate3d(0, 0, 0); 29 | box-sizing: border-box; 30 | } 31 | 32 | .page-content { 33 | position: relative; 34 | z-index: 1; 35 | height: 100%; 36 | background-color: @colorWhite; 37 | box-sizing: border-box; 38 | .scrollable(); 39 | } 40 | -------------------------------------------------------------------------------- /generator/template-base/src/assets/fonts/iconfont.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "iconfont"; 3 | src: url("iconfont.eot?t=1502076641440"); /* IE9*/ 4 | src: url("iconfont.eot?t=1502076641440#iefix") format("embedded-opentype"), 5 | /* IE6-IE8 */ url("iconfont.woff?t=1502076641440") format("woff"), 6 | /* chrome, firefox */ url("iconfont.ttf?t=1502076641440") format("truetype"), 7 | /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ 8 | url("iconfont.svg?t=1502076641440#iconfont") format("svg"); /* iOS 4.1- */ 9 | } 10 | 11 | .iconfont { 12 | font-family: "iconfont" !important; 13 | font-size: 16px; 14 | font-style: normal; 15 | -webkit-font-smoothing: antialiased; 16 | -moz-osx-font-smoothing: grayscale; 17 | } 18 | 19 | .iconfont-clock:before { 20 | content: "\e606"; 21 | } 22 | -------------------------------------------------------------------------------- /generator/miniprogram/global.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.png'; 2 | declare module '*.gif'; 3 | declare module '*.jpg'; 4 | declare module '*.jpeg'; 5 | declare module '*.svg'; 6 | declare module '*.css'; 7 | declare module '*.less'; 8 | declare module '*.scss'; 9 | declare module '*.sass'; 10 | declare module '*.styl'; 11 | 12 | // @ts-ignore 13 | declare const process: { 14 | env: { 15 | TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt' | 'quickapp' | 'qq' | 'jd'; 16 | [key: string]: any; 17 | }; 18 | }; 19 | 20 | declare namespace NodeJS { 21 | interface ProcessEnv { 22 | TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt' | 'quickapp' | 'qq' | 'jd'; 23 | } 24 | interface Global { 25 | globalData: object; 26 | } 27 | } 28 | 29 | declare const IS_H5: any; 30 | declare const IS_WEAPP: any; 31 | declare const IS_RN: any; 32 | -------------------------------------------------------------------------------- /generator/wui.js: -------------------------------------------------------------------------------- 1 | module.exports = (api, options, rootOptions) => { 2 | let devDependencies = {}; 3 | if (options.language === 'js') { 4 | devDependencies = { 5 | 'babel-plugin-import': '^1.13.0' 6 | }; 7 | } else { 8 | devDependencies = { 9 | 'ts-import-plugin': '^1.6.6' 10 | }; 11 | } 12 | 13 | if (options.preset === 'v2') { 14 | api.extendPackage({ 15 | dependencies: { 16 | '@winner-fed/win-ui': '^0.0.3' 17 | }, 18 | devDependencies 19 | }); 20 | } 21 | 22 | if (options.language === 'js') { 23 | if (options.preset === 'v2') { 24 | api.render('../ui/wui'); 25 | } 26 | } else { 27 | if (options.preset === 'v2') { 28 | api.render('../ui/wui-ts'); 29 | } 30 | } 31 | api.injectImports('src/vendor/index.js', `import './wui.js'`); 32 | api.onCreateComplete(() => {}); 33 | }; 34 | -------------------------------------------------------------------------------- /generator/template-base/src/assets/style/variable.less: -------------------------------------------------------------------------------- 1 | // color 2 | @colorBlueMain: #43a9f1; 3 | @colorBlueLight: #49b2f5; 4 | @colorBlueText: #0076ff; 5 | 6 | @colorGrayMain: #414141; 7 | @colorGrayLight: #f3f3f3; 8 | @colorGrayAssist: #e1e1e1; 9 | @colorBorder: #e9e9e9; 10 | @colorGray: #c8c8c8; 11 | @colorAfter: #eee; 12 | @tabBorder: #d9d9d9; 13 | 14 | @colorWhite: #fff; 15 | @colorBlack: #333; 16 | 17 | // font 18 | @fontColor: @colorGrayMain; 19 | @fontColorBlack: @colorBlack; 20 | @fontColorLight: @colorGrayLight; 21 | @fontColorAssist: @colorGrayAssist; 22 | 23 | // bg 24 | @bgColor: #f2f2f2; 25 | @bgColorLight: #f7f7f7; 26 | 27 | //line 28 | @colorLine: @colorGrayAssist; 29 | 30 | //colorAssist 31 | @colorRed: #ff5648; 32 | @colorGreen: #47b34f; 33 | @colorOrange: #ffaf32; 34 | @colorOrangeLight: #ffb42f; 35 | 36 | //fontSize 37 | @fontSizeH1: 20px; 38 | @fontSizeH2: 16px; 39 | @fontSizeH3: 14px; 40 | @fontSizeH4: 12px; 41 | -------------------------------------------------------------------------------- /generator/subsystem/src/App.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 40 | -------------------------------------------------------------------------------- /generator/miniprogram/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2017", 4 | "module": "commonjs", 5 | "removeComments": false, 6 | "preserveConstEnums": true, 7 | "moduleResolution": "node", 8 | "experimentalDecorators": true, 9 | "noImplicitAny": false, 10 | "allowSyntheticDefaultImports": true, 11 | "outDir": "lib", 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "strictNullChecks": true, 15 | "sourceMap": true, 16 | "baseUrl": ".", 17 | "rootDir": ".", 18 | "allowJs": true, 19 | "resolveJsonModule": true, 20 | "typeRoots": ["node_modules/@types", "global.d.ts"], 21 | "paths": { 22 | "@/components/*": ["./src/components/*"], 23 | "@/assets/*": ["./src/assets/*"], 24 | "@/services/*": ["./src/services/*"], 25 | "@/constants/*": ["./src/constants/*"], 26 | "@/utils/*": ["./src/utils/*"], 27 | "@/package": ["./package.json"], 28 | "@/project": ["./project.config.json"] 29 | } 30 | }, 31 | "exclude": ["node_modules", "dist"], 32 | "compileOnSave": false 33 | } 34 | -------------------------------------------------------------------------------- /generator/miniprogram/project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "miniprogramRoot": "dist/", 3 | "projectname": "myApp", 4 | "description": "taro demo", 5 | "appid": "touristappid", 6 | "setting": { 7 | "urlCheck": true, 8 | "es6": false, 9 | "enhance": false, 10 | "postcss": false, 11 | "preloadBackgroundData": false, 12 | "minified": false, 13 | "newFeature": true, 14 | "coverView": true, 15 | "nodeModules": false, 16 | "autoAudits": false, 17 | "showShadowRootInWxmlPanel": false, 18 | "scopeDataCheck": false, 19 | "uglifyFileName": false, 20 | "checkInvalidKey": true, 21 | "checkSiteMap": true, 22 | "uploadWithSourceMap": true, 23 | "compileHotReLoad": false, 24 | "useMultiFrameRuntime": false, 25 | "useApiHook": true, 26 | "useIsolateContext": true, 27 | "useCompilerModule": false, 28 | "userConfirmedUseCompilerModuleSwitch": false, 29 | "packNpmManually": false, 30 | "packNpmRelationList": [] 31 | }, 32 | "compileType": "miniprogram", 33 | "simulatorType": "wechat", 34 | "simulatorPluginLibVersion": {}, 35 | "condition": {} 36 | } 37 | -------------------------------------------------------------------------------- /generator/vant.js: -------------------------------------------------------------------------------- 1 | module.exports = (api, options, rootOptions) => { 2 | let devDependencies = {}; 3 | if (options.language === 'js') { 4 | devDependencies = { 5 | 'babel-plugin-import': '^1.13.0' 6 | }; 7 | } else { 8 | devDependencies = { 9 | 'ts-import-plugin': '^1.6.6' 10 | }; 11 | } 12 | 13 | if (options.preset === 'v2') { 14 | api.extendPackage({ 15 | dependencies: { 16 | vant: '^2.8.7' 17 | }, 18 | devDependencies 19 | }); 20 | } else { 21 | api.extendPackage({ 22 | dependencies: { 23 | vant: '^3.0.0-beta.1' 24 | }, 25 | devDependencies 26 | }); 27 | } 28 | 29 | if (options.language === 'js') { 30 | if (options.preset === 'v2') { 31 | api.render('../ui/vant'); 32 | } else { 33 | api.render('../ui/vant-v3'); 34 | } 35 | } else { 36 | if (options.preset === 'v2') { 37 | api.render('../ui/vant-ts'); 38 | } else { 39 | api.render('../ui/vant-ts-v3'); 40 | } 41 | } 42 | api.injectImports('src/vendor/index.js', `import './vant.js'`); 43 | api.onCreateComplete(() => {}); 44 | }; 45 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "esnext", 5 | "strict": true, 6 | "strictNullChecks": true, 7 | "jsx": "preserve", 8 | "importHelpers": true, 9 | "moduleResolution": "node", 10 | "experimentalDecorators": true, 11 | // JSON parse 12 | "resolveJsonModule": true, 13 | "esModuleInterop": true, 14 | // error TS7017: Index signature of object type implicitly has an 'any' type. 15 | "noImplicitAny": false, 16 | "sourceMap": true, 17 | "allowJs": true, 18 | "baseUrl": ".", 19 | "types": [ 20 | "node", 21 | "webpack-env" 22 | ], 23 | "paths": { 24 | "@/*": [ 25 | "src/*" 26 | ] 27 | }, 28 | "lib": [ 29 | "esnext", 30 | "dom", 31 | "dom.iterable", 32 | "scripthost" 33 | ] 34 | }, 35 | "include": [ 36 | "src/**/*.ts", 37 | "src/**/*.tsx", 38 | "src/**/*.vue", 39 | "tests/**/*.ts", 40 | "tests/**/*.tsx", 41 | "./types/*.d.ts" 42 | ], 43 | "exclude": [ 44 | "node_modules", 45 | "build/*.ts" 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "esnext", 5 | "strict": true, 6 | "strictNullChecks": true, 7 | "jsx": "preserve", 8 | "importHelpers": true, 9 | "moduleResolution": "node", 10 | "experimentalDecorators": true, 11 | // JSON parse 12 | "resolveJsonModule": true, 13 | "esModuleInterop": true, 14 | // error TS7017: Index signature of object type implicitly has an 'any' type. 15 | "noImplicitAny": false, 16 | "sourceMap": true, 17 | "allowJs": true, 18 | "baseUrl": ".", 19 | "types": [ 20 | "node", 21 | "webpack-env" 22 | ], 23 | "paths": { 24 | "@/*": [ 25 | "src/*" 26 | ] 27 | }, 28 | "lib": [ 29 | "esnext", 30 | "dom", 31 | "dom.iterable", 32 | "scripthost" 33 | ] 34 | }, 35 | "include": [ 36 | "src/**/*.ts", 37 | "src/**/*.tsx", 38 | "src/**/*.vue", 39 | "tests/**/*.ts", 40 | "tests/**/*.tsx", 41 | "./types/*.d.ts" 42 | ], 43 | "exclude": [ 44 | "node_modules", 45 | "build/*.ts" 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "esnext", 5 | "strict": true, 6 | "strictNullChecks": true, 7 | "jsx": "preserve", 8 | "importHelpers": true, 9 | "moduleResolution": "node", 10 | "experimentalDecorators": true, 11 | // JSON parse 12 | "resolveJsonModule": true, 13 | "esModuleInterop": true, 14 | // error TS7017: Index signature of object type implicitly has an 'any' type. 15 | "noImplicitAny": false, 16 | "sourceMap": true, 17 | "allowJs": true, 18 | "baseUrl": ".", 19 | "types": [ 20 | "node", 21 | "webpack-env", 22 | "vite/client" 23 | ], 24 | "paths": { 25 | "@/*": [ 26 | "src/*" 27 | ] 28 | }, 29 | "lib": [ 30 | "esnext", 31 | "dom", 32 | "dom.iterable", 33 | "scripthost" 34 | ] 35 | }, 36 | "include": [ 37 | "src/**/*.ts", 38 | "src/**/*.tsx", 39 | "src/**/*.vue", 40 | "tests/**/*.ts", 41 | "tests/**/*.tsx", 42 | "./types/*.d.ts" 43 | ], 44 | "exclude": [ 45 | "node_modules" 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /generator/template-base/prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // 行尾需要有分号 3 | semi: true, 4 | // 不使用缩进符,而使用空格 5 | useTabs: false, 6 | // 使用 2 个空格缩进 7 | tabWidth: 2, 8 | // 一行最多 120 字符 9 | printWidth: 120, 10 | // 使用单引号 11 | singleQuote: true, 12 | // 末尾无逗号 13 | trailingComma: 'none', 14 | // 使用默认的折行标准 15 | proseWrap: 'preserve', 16 | // 大括号内的首尾需要空格 17 | bracketSameLine: true, 18 | // 箭头函数,只有一个参数的时候,也需要括号 19 | arrowParens: 'always', 20 | // 对象的 key 仅在必要时用引号 21 | quoteProps: 'as-needed', 22 | // jsx 不使用单引号,而使用双引号 23 | jsxSingleQuote: false, 24 | // vue 文件中的 script 和 style 内需要缩进 25 | vueIndentScriptAndStyle: true, 26 | // 根据显示样式决定 html 要不要折行 27 | htmlWhitespaceSensitivity: 'css', 28 | // 不需要自动在文件开头插入 @prettier 29 | insertPragma: false, 30 | // 不需要写文件开头的 @prettier 31 | requirePragma: false, 32 | // 换行符使用 lf 33 | endOfLine: 'lf', 34 | // 每个文件格式化的范围是文件的全部内容 35 | rangeStart: 0, 36 | rangeEnd: Infinity, 37 | // 格式化内嵌代码 38 | embeddedLanguageFormatting: 'auto', 39 | overrides: [ 40 | { 41 | files: ['*.less', '*.css'], 42 | options: { 43 | singleQuote: false 44 | } 45 | } 46 | ] 47 | }; 48 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/shim-tsx.d.ts: -------------------------------------------------------------------------------- 1 | // 文件: `shim-tsx.d.ts` 2 | import Vue, { VNode } from 'vue'; 3 | import type { ComponentRenderProxy } from '@vue/composition-api'; 4 | 5 | declare module '*.tsx' { 6 | import { defineComponent } from 'vue'; 7 | const component: ReturnType; 8 | // import { ComponentOptions } from 'vue'; 9 | // const component: ReturnType; 10 | export default component; 11 | } 12 | 13 | declare global { 14 | namespace JSX { 15 | // tslint:disable no-empty-interface 16 | type Element = VNode; 17 | // tslint:disable no-empty-interface 18 | type ElementClass = ComponentRenderProxy; 19 | interface ElementAttributesProperty { 20 | $props: any; // 定义要使用的属性名称 21 | } 22 | interface IntrinsicElements { 23 | [elem: string]: any; 24 | } 25 | interface IntrinsicAttributes { 26 | // ['v-if']?: unknown; 27 | // ['v-else-if']?: unknown; 28 | // ['v-else']?: unknown; 29 | // need 30 | // ['v-show']?: unknown; 31 | [elem: string]: any; 32 | // ['v-html']?: unknown; 33 | // ['v-text']?: unknown; 34 | // ['v-model']?: unknown; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /generator/miniprogram/src/constants/status.ts: -------------------------------------------------------------------------------- 1 | export const HTTP_STATUS = { 2 | SUCCESS: 200, 3 | CLIENT_ERROR: 400, 4 | AUTHENTICATE: 401, 5 | FORBIDDEN: 403, 6 | NOT_FOUND: 404, 7 | SERVER_ERROR: 500, 8 | BAD_GATEWAY: 502, 9 | SERVICE_UNAVAILABLE: 503, 10 | GATEWAY_TIMEOUT: 504 11 | }; 12 | 13 | export const CODE_MESSAGE = { 14 | 200: '服务器成功返回请求的数据。', 15 | 201: '新建或修改数据成功。', 16 | 202: '一个请求已经进入后台排队(异步任务)。', 17 | 204: '删除数据成功。', 18 | 400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。', 19 | 401: '用户没有权限(令牌、用户名、密码错误)。', 20 | 403: '用户得到授权,但是访问是被禁止的。', 21 | 404: '发出的请求针对的是不存在的记录,服务器没有进行操作。', 22 | 406: '请求的格式不可得。', 23 | 410: '请求的资源被永久删除,且不会再得到的。', 24 | 412: '访问被拒绝,请重新登录', 25 | 422: '当创建一个对象时,发生一个验证错误。', 26 | 500: '服务器发生错误,请检查服务器。', 27 | 502: '网关错误。', 28 | 503: '服务不可用,服务器暂时过载或维护。', 29 | 504: '网关超时。' 30 | }; 31 | 32 | // promise status 33 | export const SUCCESS = { success: 'success' }; 34 | export const FAIL = { fail: 'fail' }; 35 | export const COMPLETE = { complete: 'complete' }; 36 | 37 | export const PROMISE_STATUS = { 38 | success: 'success', 39 | fail: 'fail', 40 | complete: 'complete' 41 | }; 42 | 43 | export const RESULT_STATUS = { 44 | SUCCESS: 0, 45 | SIGNATURE_FAILED: 1000 // 签名失败 46 | }; 47 | -------------------------------------------------------------------------------- /generator/template-base/build/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const fs = require('fs'); 4 | const path = require('path'); 5 | const {sh, cli} = require('tasksfile'); 6 | const chalk = require('chalk'); 7 | const rawArgv = process.argv.slice(2); 8 | const args = rawArgv.join(' '); 9 | 10 | const resolve = (dir) => { 11 | return path.join(__dirname, '../', dir); 12 | }; 13 | 14 | // 便于捕捉 build 之后的错误,然后进行自定义处理 15 | // 配合 jenkins 执行 job 16 | function command() { 17 | sh(`vue-cli-service build ${args}`, { 18 | async: true, 19 | stdio: 'inherit' 20 | }) 21 | .then((output) => { 22 | <%_ if (options.application === 'offline') { _%> 23 | // 离线包的说明信息 24 | fs.createReadStream(resolve(`offlinePackage.json`)) 25 | .pipe(fs.createWriteStream(resolve('dist/offlinePackage.json'))); 26 | <%_ } _%> 27 | console.log(chalk.cyan(output || '')); 28 | }) 29 | .catch((err) => { 30 | console.error('\n'); 31 | console.error(chalk.magenta('编译打包出错了 ~~~~(>_<)~~~~ \n')); 32 | console.error(chalk.magenta('具体错误信息如下 \n')); 33 | console.error(chalk.red(`${err}.\n`)); 34 | console.log(chalk.red(' Build failed with errors.\n')); 35 | process.exit(1); 36 | }); 37 | } 38 | 39 | command(); 40 | -------------------------------------------------------------------------------- /generator/miniprogram/src/utils/jump.ts: -------------------------------------------------------------------------------- 1 | import Taro from '@tarojs/taro'; 2 | 3 | const PAGE_WEBVIEW = '/pages/webview/index'; 4 | 5 | function urlStringify(url, payload, encode = true) { 6 | const arr = Object.keys(payload).map( 7 | (key) => `${key}=${encode ? encodeURIComponent(payload[key]) : payload[key]}` 8 | ); 9 | 10 | // NOTE 注意支付宝小程序跳转链接如果没有参数,就不要带上 ?,否则可能无法跳转 11 | return arr.length ? `${url}?${arr.join('&')}` : url; 12 | } 13 | 14 | /** 15 | * // NOTE 后端返回的 url 可能是网页链接,需要在 webview 中打开 16 | * 也可能是小程序自身的链接,只能用 navigate/redirect 之类的打开 17 | * 就需要有个地方统一判断处理 18 | */ 19 | export default function jump(options) { 20 | const { url, title = '', payload = {}, method = 'navigateTo' } = options; 21 | 22 | if (/^https?:\/\//.test(url)) { 23 | Taro[method]({ 24 | url: urlStringify(PAGE_WEBVIEW, { url, title }) 25 | }); 26 | } else if (/^\/pages\//.test(url)) { 27 | // TODO H5 不支持 switchTab,暂时 hack 下 28 | if (process.env.TARO_ENV === 'h5' && method === 'switchTab') { 29 | Taro.navigateBack({ delta: Taro.getCurrentPages().length - 1 }); 30 | setTimeout(() => { 31 | Taro.redirectTo({ url }); 32 | }, 100); 33 | return; 34 | } 35 | 36 | Taro[method]({ 37 | url: urlStringify(url, payload) 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-preset", 3 | "version": "1.1.2", 4 | "description": "结合 vue-cli 的 preset 搭建基于 git repo 的前端项目模板", 5 | "main": "./generator/index.js", 6 | "directories": { 7 | "doc": "docs" 8 | }, 9 | "scripts": { 10 | "docs:dev": "vuepress dev docs", 11 | "docs:build": "vuepress build docs", 12 | "deploy": "bash ./docs/deploy.sh", 13 | "test": "echo \"Error: no test specified\" && exit 1" 14 | }, 15 | "husky": { 16 | "hooks": { 17 | "pre-commit": "lint-staged" 18 | } 19 | }, 20 | "lint-staged": { 21 | "*.md": "prettier --write", 22 | "*.{js,vue,less,css,ts,tsx}": "prettier --write" 23 | }, 24 | "repository": { 25 | "type": "git", 26 | "url": "git+https://github.com/cklwblove/vue-preset.git" 27 | }, 28 | "keywords": [ 29 | "vue-cli4", 30 | "vue2", 31 | "vue3", 32 | "preset" 33 | ], 34 | "author": "liwb", 35 | "license": "MIT", 36 | "bugs": { 37 | "url": "https://github.com/cklwblove/vue-preset/issues" 38 | }, 39 | "homepage": "https://github.com/cklwblove/vue-preset#readme", 40 | "devDependencies": { 41 | "@vue/eslint-config-prettier": "^6.0.0", 42 | "husky": "^4.3.7", 43 | "lint-staged": "^10.5.3", 44 | "prettier": "^2.2.1", 45 | "vuepress": "^0.14.8" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /generator/subsystem/build/package/see.child.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra'); 2 | const { generateSeePackageZip } = require('@winner-fed/winner-deploy'); 3 | const { generateSeePackageInfo } = require('../utils'); 4 | 5 | // 系统分类,必须按照实际项目要求填写 6 | const system = 'winner-front'; 7 | 8 | if (!system) { 9 | throw new Error('system 不能为空!根据实际项目需求进行命名!'); 10 | } 11 | 12 | const type = 'subsystem'; 13 | const configName = 'sysconfig'; 14 | 15 | async function init() { 16 | // 1. 生成 see 发布物的名称 17 | const { seePackageName, seePackageOptions } = generateSeePackageInfo({ system, type }); 18 | 19 | // 2. 移除 package 文件夹 20 | fs.removeSync('./package'); 21 | 22 | // 3. 生成 see 平台发布物 23 | // 生成 docker 包的同时也生成 see 包 24 | if (seePackageOptions.seePackageType === 'docker') { 25 | generateSeePackageZip( 26 | { 27 | ...seePackageOptions, 28 | configName, 29 | seePackageName 30 | }, 31 | function () { 32 | generateSeePackageZip({ 33 | ...seePackageOptions, 34 | seePackageType: 'web', 35 | configName, 36 | seePackageName: seePackageName.replace('-docker', '') 37 | }); 38 | } 39 | ); 40 | 41 | return; 42 | } 43 | 44 | generateSeePackageZip({ 45 | ...seePackageOptions, 46 | configName, 47 | seePackageName 48 | }); 49 | } 50 | 51 | init().catch((e) => { 52 | console.error(e); 53 | }); 54 | -------------------------------------------------------------------------------- /generator/template-base/build/package/see.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra'); 2 | const { generateSeePackageZip } = require('@winner-fed/winner-deploy'); 3 | const { generateSeePackageInfo } = require('../utils'); 4 | 5 | // 系统分类,必须按照实际项目要求填写 6 | const system = 'winner-front'; 7 | 8 | if (!system) { 9 | throw new Error('system 不能为空!根据实际项目需求进行命名!'); 10 | } 11 | 12 | const type = 'bizframe'; 13 | const configName = 'config.local'; 14 | 15 | async function init() { 16 | // 1. 生成 see 发布物的名称及参数 17 | const { seePackageName, seePackageOptions } = generateSeePackageInfo({ system, type }); 18 | 19 | // 2. 移除 package 文件夹 20 | fs.removeSync('./package'); 21 | 22 | // 3. 生成 see 平台发布物 23 | // 生成 docker 包的同时也生成 see 包 24 | if (seePackageOptions.seePackageType === 'docker') { 25 | generateSeePackageZip( 26 | { 27 | ...seePackageOptions, 28 | configName, 29 | seePackageName 30 | }, 31 | function () { 32 | generateSeePackageZip({ 33 | ...seePackageOptions, 34 | seePackageType: 'web', 35 | configName, 36 | seePackageName: seePackageName.replace('-docker', '') 37 | }); 38 | } 39 | ); 40 | 41 | return; 42 | } 43 | 44 | generateSeePackageZip({ 45 | ...seePackageOptions, 46 | configName, 47 | seePackageName 48 | }); 49 | } 50 | 51 | init().catch((e) => { 52 | console.error(e); 53 | }); 54 | -------------------------------------------------------------------------------- /generator/template-vue2/src/views/svgIcons/index.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 31 | 32 | 63 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/cloud-templates/vue-preset) 2 | 3 | # vue-preset 4 | 结合 vue-cli4.x 的 preset 搭建基于 git repo 的前端项目模板。**支持Vue3.0特性** 5 | 6 | **注意:本脚手架不做维护,请转移到 [create-project](https://github.com/cloud-templates/create-project)** 7 | 8 | ## 快速开始 9 | 10 | ```bash 11 | # 安装 vue-cli 4.0 12 | npm install -g @vue/cli 13 | 14 | # 根据远程 preset 创建项目 15 | vue create --preset cloud-templates/vue-preset my-project 16 | # or 17 | vue create --preset direct:https://github.com/cloud-templates/vue-preset.git my-project --clone 18 | 19 | # 本地预览 20 | cd my-project && yarn run serve 21 | 22 | ``` 23 | 24 | ## 文档 25 | ```bash 26 | # 本地预览 27 | npm run docs:dev 28 | 29 | # 构建部署版本 30 | npm run docs:build 31 | ``` 32 | ## 待办 33 | - [ ] 新增**多页**模板 34 | - [x] 支持 REST 接口规范,可以参考 [restful](https://github.com/cklwblove/vue-preset/blob/ece3b851d947ec00d42815919ca32bb1e84be1b3/generator/template/src/services/request.js#L136) 35 | - [x] axios retry 特性,可以参考 [axios-retry](https://github.com/cklwblove/vue-preset/blob/axios-retry/generator/template/src/services/request.js) 36 | - [x] axios cancel request 37 | - [x] 引入 vant-ui 38 | - [x] 新增**TS**模板 39 | - [x] 新增离线包相关特性 40 | - [x] 支持vue3.0 41 | - [x] vue2.x 支持新的构建工具 vite 42 | 43 | ## 统计 44 | ![Alt](https://repobeats.axiom.co/api/embed/180b11b920e072bf5bdde5581431de24bc1bbf90.svg "Repobeats analytics image") 45 | -------------------------------------------------------------------------------- /generator/template-vue2/src/icons/svg/dog.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/icons/svg/dog.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/icons/svg/dog.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /generator/template-vue3/src/icons/svg/dog.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/icons/svg/dog.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/icons/svg/dog.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /generator/template-base/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ignores: [(commit) => commit.includes('init')], 3 | extends: ['@commitlint/config-conventional'], 4 | parserPreset: { 5 | parserOpts: { 6 | headerPattern: /^(\w*|[\u4e00-\u9fa5]*)(?:[\(\(](.*)[\)\)])?[\:\:] (.*)/, 7 | headerCorrespondence: ['type', 'scope', 'subject'], 8 | referenceActions: [ 9 | 'close', 10 | 'closes', 11 | 'closed', 12 | 'fix', 13 | 'fixes', 14 | 'fixed', 15 | 'resolve', 16 | 'resolves', 17 | 'resolved', 18 | ], 19 | issuePrefixes: ['#'], 20 | noteKeywords: ['BREAKING CHANGE'], 21 | fieldPattern: /^-(.*?)-$/, 22 | revertPattern: /^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\./, 23 | revertCorrespondence: ['header', 'hash'], 24 | warn() {}, 25 | mergePattern: null, 26 | mergeCorrespondence: null, 27 | }, 28 | }, 29 | rules: { 30 | 'body-leading-blank': [2, 'always'], 31 | 'footer-leading-blank': [1, 'always'], 32 | 'header-max-length': [2, 'always', 108], 33 | 'subject-empty': [2, 'never'], 34 | 'type-empty': [2, 'never'], 35 | 'type-enum': [ 36 | 2, 37 | 'always', 38 | [ 39 | 'feat', 40 | 'fix', 41 | 'perf', 42 | 'style', 43 | 'docs', 44 | 'test', 45 | 'refactor', 46 | 'build', 47 | 'ci', 48 | 'chore', 49 | 'revert', 50 | 'wip', 51 | 'workflow', 52 | 'types', 53 | 'release', 54 | ], 55 | ], 56 | }, 57 | }; 58 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/pwa/register-service-worker.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | 3 | import { register } from 'register-service-worker'; 4 | 5 | if (process.env.NODE_ENV === 'production') { 6 | register(`${process.env.BASE_URL}service-worker.js`, { 7 | ready() { 8 | console.log( 9 | 'App is being served from cache by a service worker.\n' + 10 | 'For more details, visit https://goo.gl/AFskqB' 11 | ); 12 | }, 13 | registered(registration) { 14 | console.log('Service worker has been registered.'); 15 | // Routinely check for app updates by testing for a new service worker. 16 | setInterval(() => { 17 | registration.update(); 18 | }, 1000 * 60 * 60); // hourly checks 19 | }, 20 | cached() { 21 | console.log('Content has been cached for offline use.'); 22 | }, 23 | updatefound() { 24 | console.log('New content is downloading.'); 25 | }, 26 | updated(registration) { 27 | console.log('New content is available; please refresh.'); 28 | // Add a custom event and dispatch it. 29 | // Used to display of a 'refresh' banner following a service worker update. 30 | // Set the event payload to the service worker registration object. 31 | document.dispatchEvent( 32 | new CustomEvent('swUpdated', { detail: registration }) 33 | ); 34 | }, 35 | offline() { 36 | console.log( 37 | 'No internet connection found. App is running in offline mode.' 38 | ); 39 | }, 40 | error(error) { 41 | console.error('Error during service worker registration:', error); 42 | } 43 | }); 44 | } 45 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/pwa/register-service-worker.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | 3 | import { register } from 'register-service-worker'; 4 | 5 | if (process.env.NODE_ENV === 'production') { 6 | register(`${process.env.BASE_URL}service-worker.js`, { 7 | ready() { 8 | console.log( 9 | 'App is being served from cache by a service worker.\n' + 10 | 'For more details, visit https://goo.gl/AFskqB' 11 | ); 12 | }, 13 | registered(registration) { 14 | console.log('Service worker has been registered.'); 15 | // Routinely check for app updates by testing for a new service worker. 16 | setInterval(() => { 17 | registration.update(); 18 | }, 1000 * 60 * 60); // hourly checks 19 | }, 20 | cached() { 21 | console.log('Content has been cached for offline use.'); 22 | }, 23 | updatefound() { 24 | console.log('New content is downloading.'); 25 | }, 26 | updated(registration) { 27 | console.log('New content is available; please refresh.'); 28 | // Add a custom event and dispatch it. 29 | // Used to display of a 'refresh' banner following a service worker update. 30 | // Set the event payload to the service worker registration object. 31 | document.dispatchEvent( 32 | new CustomEvent('swUpdated', { detail: registration }) 33 | ); 34 | }, 35 | offline() { 36 | console.log( 37 | 'No internet connection found. App is running in offline mode.' 38 | ); 39 | }, 40 | error(error) { 41 | console.error('Error during service worker registration:', error); 42 | } 43 | }); 44 | } 45 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/pwa/register-service-worker.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | 3 | import { register } from 'register-service-worker'; 4 | 5 | if (process.env.NODE_ENV === 'production') { 6 | register(`${process.env.BASE_URL}service-worker.js`, { 7 | ready() { 8 | console.log( 9 | 'App is being served from cache by a service worker.\n' + 10 | 'For more details, visit https://goo.gl/AFskqB' 11 | ); 12 | }, 13 | registered(registration) { 14 | console.log('Service worker has been registered.'); 15 | // Routinely check for app updates by testing for a new service worker. 16 | setInterval(() => { 17 | registration.update(); 18 | }, 1000 * 60 * 60); // hourly checks 19 | }, 20 | cached() { 21 | console.log('Content has been cached for offline use.'); 22 | }, 23 | updatefound() { 24 | console.log('New content is downloading.'); 25 | }, 26 | updated(registration) { 27 | console.log('New content is available; please refresh.'); 28 | // Add a custom event and dispatch it. 29 | // Used to display of a 'refresh' banner following a service worker update. 30 | // Set the event payload to the service worker registration object. 31 | document.dispatchEvent( 32 | new CustomEvent('swUpdated', { detail: registration }) 33 | ); 34 | }, 35 | offline() { 36 | console.log( 37 | 'No internet connection found. App is running in offline mode.' 38 | ); 39 | }, 40 | error(error) { 41 | console.error('Error during service worker registration:', error); 42 | } 43 | }); 44 | } 45 | -------------------------------------------------------------------------------- /generator/miniprogram/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 44 | 45 | 46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /generator/miniprogram/src/pages/index/index.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 61 | -------------------------------------------------------------------------------- /generator/template-base/tools/init.js: -------------------------------------------------------------------------------- 1 | // 2 | const { readFileSync, writeFileSync } = require('fs'); 3 | const chalk = require('chalk'); 4 | const path = require('path'); 5 | const { rm, exec } = require('shelljs'); 6 | // Note: These should all be relative to the project root directory 7 | const rmFiles = [ 8 | 'tools/init.js' 9 | ]; 10 | 11 | /** 12 | * Removes items from the project that aren't needed after the initial setup 13 | */ 14 | function removeItems () { 15 | console.log(chalk.white('Removed')); 16 | 17 | // The directories and files are combined here, to simplify the function, 18 | // as the 'rm' command checks the item type before attempting to remove it 19 | let rmItems = rmFiles; 20 | rm('-rf', path.resolve(__dirname, '..', 'tools')); 21 | console.log(chalk.red(rmItems.join('\n'))); 22 | 23 | console.log('\n'); 24 | } 25 | 26 | /** 27 | * Calls any external programs to finish setting up the library 28 | */ 29 | function finalize () { 30 | console.log(chalk.white('Finalizing')); 31 | // git 32 | <%_ if (options['version-control'] === 'git') { _%> 33 | exec('npm run install:husky'); 34 | <%_ } _%> 35 | exec('npm run prettier'); 36 | exec('npm run lint'); 37 | exec('npm run lint:style'); 38 | // Remove post-install command 39 | let jsonPackage = path.resolve(__dirname, '..', 'package.json'); 40 | const pkg = JSON.parse(readFileSync(jsonPackage)); 41 | 42 | // Note: Add items to remove from the package file here 43 | delete pkg.scripts.postinstall; 44 | 45 | writeFileSync(jsonPackage, JSON.stringify(pkg, null, 2)); 46 | console.log(chalk.green('Postinstall script has been removed')); 47 | 48 | console.log('\n'); 49 | } 50 | 51 | (() => { 52 | removeItems(); 53 | finalize(); 54 | })(); 55 | -------------------------------------------------------------------------------- /generator/template-vue2/src/icons/components/dog.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* tslint:disable */ 3 | // @ts-ignore 4 | import icon from 'vue-svgicon'; 5 | icon.register({ 6 | dog: { 7 | width: 225, 8 | height: 200, 9 | viewBox: '0 0 1152 1024', 10 | data: 11 | '' 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/icons/components/dog.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* tslint:disable */ 3 | // @ts-ignore 4 | import icon from 'vue-svgicon'; 5 | icon.register({ 6 | dog: { 7 | width: 225, 8 | height: 200, 9 | viewBox: '0 0 1152 1024', 10 | data: 11 | '' 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/icons/components/dog.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* tslint:disable */ 3 | // @ts-ignore 4 | import icon from 'vue-svgicon'; 5 | icon.register({ 6 | dog: { 7 | width: 225, 8 | height: 200, 9 | viewBox: '0 0 1152 1024', 10 | data: 11 | '' 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/icons/components/dog.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* tslint:disable */ 3 | // @ts-ignore 4 | import icon from 'vue-svgicon'; 5 | icon.register({ 6 | dog: { 7 | width: 225, 8 | height: 200, 9 | viewBox: '0 0 1152 1024', 10 | data: 11 | '' 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /generator/template-base/src/assets/fonts/demo_fontclass.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | IconFont 7 | 8 | 9 | 10 | 11 |
12 |

IconFont 图标

13 |
    14 | 15 |
  • 16 | 17 |
    clock
    18 |
    .icon-clock
    19 |
  • 20 | 21 |
22 | 23 |

font-class引用

24 |
25 | 26 |

font-class是unicode使用方式的一种变种,主要是解决unicode书写不直观,语意不明确的问题。

27 |

与unicode使用方式相比,具有如下特点:

28 |
    29 |
  • 兼容性良好,支持ie8+,及所有现代浏览器。
  • 30 |
  • 相比于unicode语意明确,书写更直观。可以很容易分辨这个icon是什么。
  • 31 |
  • 因为使用class来定义图标,所以当要替换图标时,只需要修改class里面的unicode引用。
  • 32 |
  • 不过因为本质上还是使用的字体,所以多色图标还是不支持的。
  • 33 |
34 |

使用步骤如下:

35 |

第一步:引入项目下面生成的fontclass代码:

36 | 37 | 38 |
<link rel="stylesheet" type="text/css" href="./iconfont.css">
39 |

第二步:挑选相应图标并获取类名,应用于页面:

40 |
<i class="iconfont icon-xxx"></i>
41 |
42 |

"iconfont"是你项目下的font-family。可以通过编辑项目查看,默认是"iconfont"。

43 |
44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /generator/template-vue3/src/main.js: -------------------------------------------------------------------------------- 1 | import 'core-js/stable'; 2 | import 'regenerator-runtime/runtime'; 3 | <%_ if ((options.application === 'mobile' || options.application === 'offline') && options['layout-adapter'] !== 'vw') { _%> 4 | import 'amfe-flexible'; 5 | <%_ } _%> 6 | import { createApp } from 'vue'; 7 | import App from './App.vue'; 8 | import { setupRouter } from './router/index.js'; 9 | import './router/router.interceptor'; 10 | import { setGlobalProperties } from '@/services'; 11 | import setupSvgIcon from './icons'; 12 | import { setApp } from './useApp'; 13 | <%_ if (options['ui-framework'] === 'element-ui') { _%> 14 | import setupVendor from './vendor/element'; 15 | <%_ } else if (options['ui-framework'] === 'iview') { _%> 16 | import './vendor/iview'; 17 | <%_ } else if (options['ui-framework'] === 'ant') { _%> 18 | import setupVendor from './vendor/ant'; 19 | <%_ } else if (options['ui-framework'] === 'hui') { _%> 20 | import './vendor/hui'; 21 | <%_ } else if (options['mobile-ui-framework'] === 'vant') { _%> 22 | import setupVendor from './vendor/vant'; 23 | <%_ } _%> 24 | <%_ if (options.application === 'offline') { _%> 25 | import {isLightOS, nativeReady} from '@winner-fed/native-bridge-methods'; 26 | import LightSDK from 'light-sdk/dist/index.umd'; 27 | 28 | window.LightSDK = LightSDK; 29 | <%_ } _%> 30 | 31 | import './assets/style/app.less'; 32 | 33 | const app = createApp(App); 34 | 35 | setGlobalProperties(app); 36 | <%_ if (options['ui-framework'] === 'element-ui' || options['ui-framework'] === 'ant' || options['mobile-ui-framework'] === 'vant') { _%> 37 | setupVendor(app); 38 | <%_ } _%> 39 | setupSvgIcon(app); 40 | setupRouter(app); 41 | 42 | <%_ if (options.application === 'offline') { _%> 43 | if (isLightOS()) { 44 | nativeReady().then(() => { 45 | app.mount('#app'); 46 | }); 47 | } else { 48 | app.mount('#app'); 49 | } 50 | <%_ } else { _%> 51 | app.mount('#app'); 52 | <%_ } _%> 53 | 54 | setApp(app); 55 | -------------------------------------------------------------------------------- /generator/miniprogram/src/utils/serialize.ts: -------------------------------------------------------------------------------- 1 | export const indexOf = (haystack, needle) => { 2 | for (let i = 0; i < haystack.length; ++i) { 3 | if (haystack[i] === needle) return i; 4 | } 5 | return -1; 6 | }; 7 | 8 | export const stringify = (obj, replacer?, spaces?, cycleReplacer?) => { 9 | return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces); 10 | }; 11 | 12 | export const stringifyError = (value) => { 13 | let err = { 14 | stack: value.stack, 15 | message: value.message, 16 | name: value.name 17 | }; 18 | 19 | for (let i in value) { 20 | if (Object.prototype.hasOwnProperty.call(value, i)) { 21 | err[i] = value[i]; 22 | } 23 | } 24 | 25 | return err; 26 | }; 27 | 28 | export const serializer = (replacer, cycleReplacer) => { 29 | let stack = []; 30 | let keys = []; 31 | 32 | if (cycleReplacer == null) { 33 | cycleReplacer = function (key, value) { 34 | if (stack[0] === value) { 35 | return '[Circular ~]'; 36 | } 37 | return '[Circular ~.' + keys.slice(0, indexOf(stack, value)).join('.') + ']'; 38 | }; 39 | } 40 | 41 | return function (key, value) { 42 | if (stack.length > 0) { 43 | let thisPos = indexOf(stack, this); 44 | // @ts-ignore 45 | ~thisPos ? stack.splice(thisPos + 1) : stack.push(this); 46 | ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key); 47 | 48 | if (~indexOf(stack, value)) { 49 | value = cycleReplacer.call(this, key, value); 50 | } 51 | } else { 52 | stack.push(value); 53 | } 54 | 55 | return replacer == null 56 | ? value instanceof Error 57 | ? stringifyError(value) 58 | : value 59 | : replacer.call(this, key, value); 60 | }; 61 | }; 62 | 63 | // try { 64 | // throw new Error("Whoops!"); 65 | // } catch (e) { 66 | // e.name = {stark:'wang',hehe:{hh:'111'}} 67 | // let ee = stringify(e) 68 | // console.log(typeof ee) 69 | // } 70 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/main.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/stable'; 2 | import 'regenerator-runtime/runtime'; 3 | <%_ if ((options.application === 'mobile' || options.application === 'offline') && options['layout-adapter'] !== 'vw') { _%> 4 | import 'amfe-flexible'; 5 | <%_ } _%> 6 | import { createApp } from 'vue'; 7 | import App from './App.vue'; 8 | import { setupRouter } from './router'; 9 | import './router/router.interceptor'; 10 | import { setGlobalProperties } from '@/services'; 11 | import './pwa/register-service-worker'; 12 | import setupSvgIcon from './icons'; 13 | <%_ if (options['ui-framework'] === 'element-ui') { _%> 14 | import setupVendor from './vendor/element'; 15 | <%_ } else if (options['ui-framework'] === 'iview') { _%> 16 | import './vendor/iview'; 17 | <%_ } else if (options['ui-framework'] === 'ant') { _%> 18 | import setupVendor from './vendor/ant'; 19 | <%_ } else if (options['ui-framework'] === 'hui') { _%> 20 | import './vendor/hui'; 21 | <%_ } else if (options['mobile-ui-framework'] === 'vant') { _%> 22 | import setupVendor from './vendor/vant'; 23 | <%_ } _%> 24 | <%_ if (options.application === 'offline') { _%> 25 | import {isLightOS, nativeReady} from '@winner-fed/native-bridge-methods'; 26 | import LightSDK from 'light-sdk/dist/index.umd'; 27 | 28 | window.LightSDK = LightSDK; 29 | <%_ } _%> 30 | import { setApp } from './useApp'; 31 | 32 | import './assets/style/app.less'; 33 | 34 | const app = createApp(App); 35 | 36 | setGlobalProperties(app); 37 | <%_ if (options['ui-framework'] === 'element-ui' || options['ui-framework'] === 'ant' || options['mobile-ui-framework'] === 'vant') { _%> 38 | setupVendor(app); 39 | <%_ } _%> 40 | setupSvgIcon(app); 41 | setupRouter(app); 42 | 43 | <%_ if (options.application === 'offline') { _%> 44 | if (isLightOS()) { 45 | nativeReady().then(() => { 46 | app.mount('#app'); 47 | }); 48 | } else { 49 | app.mount('#app'); 50 | } 51 | <%_ } else { _%> 52 | app.mount('#app'); 53 | <%_ } _%> 54 | setApp(app); 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /generator/subsystem/src/components/QuickNavigation/index.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 45 | 46 | 80 | -------------------------------------------------------------------------------- /generator/template-base/vite.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const {defineConfig} = require('vite'); 3 | const {createVuePlugin} = require('vite-plugin-vue2'); 4 | const {injectHtml} = require('vite-plugin-html'); 5 | import ViteComponents from 'vite-plugin-components'; 6 | import styleImport from 'vite-plugin-style-import'; 7 | 8 | const {genHtmlOptions} = require('./build/utils'); 9 | const resolve = (dir) => { 10 | return path.join(__dirname, '.', dir); 11 | }; 12 | const libs = []; 13 | <%_ if (options['mobile-ui-framework'] === 'vant') { _%> 14 | libs.push({ 15 | libraryName: 'vant', 16 | esModule: true, 17 | resolveStyle: (name) => { 18 | return `vant/es/${name}/style/index`; 19 | } 20 | }); 21 | <%_ } _%> 22 | <%_ if (options['mobile-ui-framework'] === 'WinUI') { _%> 23 | libs.push({ 24 | libraryName: '@winner-fed/win-ui', 25 | esModule: true, 26 | resolveStyle: (name) => { 27 | return `@winner-fed/win-ui/es/${name}/style/index`; 28 | } 29 | }); 30 | <%_ } _%> 31 | // https://vitejs.dev/config/ 32 | export default defineConfig({ 33 | base: './', 34 | define: { 35 | 'process.env': { 36 | '__TOOL_MODE__': 'vite' 37 | } 38 | }, 39 | plugins: [ 40 | createVuePlugin({}), 41 | injectHtml({ 42 | injectData: genHtmlOptions('vite'), 43 | }), 44 | ViteComponents({ 45 | transformer: 'vue2' 46 | }), 47 | styleImport({ 48 | libs: libs 49 | }) 50 | ], 51 | css: { 52 | preprocessorOptions: { 53 | less: { 54 | 'additionalData': `@import "@/assets/style/variable.less";@import "@winner-fed/magicless/magicless.less";` 55 | }, 56 | }, 57 | }, 58 | resolve: { 59 | alias: [ 60 | { 61 | // @/xxxx => src/xxx 62 | find: /^@\//, 63 | replacement: resolve('src') + '/', 64 | }, 65 | { 66 | find: /^utils/, 67 | replacement: resolve('node_modules/@winner-fed/cloud-utils/dist/cloud-utils.esm'), 68 | }, 69 | ] 70 | }, 71 | }); 72 | -------------------------------------------------------------------------------- /generator/template-base/build/zip.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const fs = require('fs'); 4 | const path = require('path'); 5 | const archiver = require('archiver'); 6 | const { formatDate } = require('@winner-fed/cloud-utils'); 7 | 8 | const DEST_DIR = path.join(__dirname, '../dist'); 9 | const DEST_ZIP_DIR = path.join(__dirname, '../dist-zip'); 10 | 11 | const extractExtensionData = () => { 12 | const extPackageJson = require('../package.json'); 13 | 14 | return { 15 | name: extPackageJson.name, 16 | version: extPackageJson.version 17 | }; 18 | }; 19 | 20 | const removeDir = function removeDir(dir) { 21 | let files = fs.readdirSync(dir); 22 | for (let i = 0; i < files.length; i++) { 23 | let newPath = path.join(dir, files[i]); 24 | let stat = fs.statSync(newPath); 25 | if (stat.isDirectory()) { 26 | // 如果是文件夹就递归下去 27 | removeDir(newPath); 28 | } else { 29 | // 删除文件 30 | fs.unlinkSync(newPath); 31 | } 32 | } 33 | // 如果文件夹是空的,就将自己删除掉 34 | fs.rmdirSync(dir); 35 | }; 36 | 37 | const makeDestZipDirIfNotExists = () => { 38 | if (!fs.existsSync(DEST_ZIP_DIR)) { 39 | fs.mkdirSync(DEST_ZIP_DIR); 40 | } else { 41 | removeDir(DEST_ZIP_DIR); 42 | fs.mkdirSync(DEST_ZIP_DIR); 43 | } 44 | }; 45 | 46 | const buildZip = (src, dist, zipFilename) => { 47 | console.info(`Building ${zipFilename}...`); 48 | 49 | const archive = archiver('zip', { zlib: { level: 9 } }); 50 | const stream = fs.createWriteStream(path.join(dist, zipFilename)); 51 | 52 | return new Promise((resolve, reject) => { 53 | archive 54 | .directory(src, false) 55 | .on('error', (err) => reject(err)) 56 | .pipe(stream); 57 | 58 | stream.on('close', () => resolve()); 59 | archive.finalize(); 60 | }); 61 | }; 62 | 63 | const main = () => { 64 | const { name, version } = extractExtensionData(); 65 | const zipFilename = `${name}-v${version}_${formatDate( 66 | new Date(), 67 | 'yyyy-MM-dd_HH-mm-ss' 68 | )}.zip`; 69 | 70 | makeDestZipDirIfNotExists(); 71 | 72 | buildZip(DEST_DIR, DEST_ZIP_DIR, zipFilename) 73 | .then(() => console.info('OK')) 74 | .catch(console.err); 75 | }; 76 | 77 | main(); 78 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/main.js: -------------------------------------------------------------------------------- 1 | import 'core-js/stable'; 2 | import 'regenerator-runtime/runtime'; 3 | <%_ if ((options.application === 'mobile' || options.application === 'offline') && options['layout-adapter'] !== 'vw') { _%> 4 | import 'amfe-flexible'; 5 | <%_ } _%> 6 | import Vue from 'vue'; 7 | import App from './App.vue'; 8 | import router from './router/index.js'; 9 | import './router/router.interceptor'; 10 | import './icons'; 11 | import './filters'; 12 | import './services'; 13 | <%_ if (options['ui-framework'] === 'element-ui') { _%> 14 | import './vendor/element'; 15 | <%_ } else if (options['ui-framework'] === 'iview') { _%> 16 | import './vendor/iview'; 17 | <%_ } else if (options['ui-framework'] === 'ant') { _%> 18 | import './vendor/ant'; 19 | <%_ } else if (options['ui-framework'] === 'hui') { _%> 20 | import './vendor/hui'; 21 | <%_ } else if (options['mobile-ui-framework'] === 'vant') { _%> 22 | import './vendor/vant'; 23 | <%_ } else if (options['mobile-ui-framework'] === 'wui') { _%> 24 | import './vendor/wui'; 25 | <%_ } _%> 26 | <%_ if (options.application === 'offline') { _%> 27 | import {isLightOS, nativeReady} from '@winner-fed/native-bridge-methods'; 28 | import LightSDK from 'light-sdk/dist/index.umd'; 29 | 30 | window.LightSDK = LightSDK; 31 | <%_ } _%> 32 | 33 | import './assets/style/app.less'; 34 | 35 | /* eslint-disable */ 36 | Vue.config.productionTip = process.env.NODE_ENV === 'production'; 37 | 38 | <%_ if (options.application === 'offline') { _%> 39 | if (isLightOS()) { 40 | nativeReady().then(() => { 41 | new Vue({ 42 | el: '#app', 43 | router, 44 | // use Runtime-only 45 | // https://vuejs.org/v2/guide/installation.html 46 | render: (h) => h(App), 47 | }); 48 | }); 49 | } else { 50 | /* eslint-disable no-new */ 51 | new Vue({ 52 | el: '#app', 53 | router, 54 | // use Runtime-only 55 | // https://vuejs.org/v2/guide/installation.html 56 | render: (h) => h(App), 57 | }); 58 | } 59 | <%_ } else { _%> 60 | /* eslint-disable no-new */ 61 | new Vue({ 62 | el: '#app', 63 | router, 64 | // use Runtime-only 65 | // https://vuejs.org/v2/guide/installation.html 66 | render: (h) => h(App) 67 | }); 68 | <%_ } _%> 69 | -------------------------------------------------------------------------------- /generator/template-vue2/src/main.js: -------------------------------------------------------------------------------- 1 | import 'core-js/stable'; 2 | import 'regenerator-runtime/runtime'; 3 | <%_ if ((options.application === 'mobile' || options.application === 'offline') && options['layout-adapter'] !== 'vw') { _%> 4 | import 'amfe-flexible'; 5 | <%_ } _%> 6 | import Vue from 'vue'; 7 | import App from './App.vue'; 8 | import router from './router/index.js'; 9 | import './router/router.interceptor'; 10 | import './components/global'; 11 | import './icons'; 12 | import './filters'; 13 | import './services'; 14 | <%_ if (options['ui-framework'] === 'element-ui') { _%> 15 | import './vendor/element'; 16 | <%_ } else if (options['ui-framework'] === 'iview') { _%> 17 | import './vendor/iview'; 18 | <%_ } else if (options['ui-framework'] === 'ant') { _%> 19 | import './vendor/ant'; 20 | <%_ } else if (options['ui-framework'] === 'hui') { _%> 21 | import './vendor/hui'; 22 | <%_ } else if (options['mobile-ui-framework'] === 'vant') { _%> 23 | import './vendor/vant'; 24 | <%_ } else if (options['mobile-ui-framework'] === 'wui') { _%> 25 | import './vendor/wui'; 26 | <%_ } _%> 27 | <%_ if (options.application === 'offline') { _%> 28 | import {isLightOS, nativeReady} from '@winner-fed/native-bridge-methods'; 29 | import LightSDK from 'light-sdk/dist/index.umd'; 30 | 31 | window.LightSDK = LightSDK; 32 | <%_ } _%> 33 | 34 | import './assets/style/app.less'; 35 | 36 | /* eslint-disable */ 37 | Vue.config.productionTip = process.env.NODE_ENV === 'production'; 38 | 39 | <%_ if (options.application === 'offline') { _%> 40 | if (isLightOS()) { 41 | nativeReady().then(() => { 42 | new Vue({ 43 | el: '#app', 44 | router, 45 | // use Runtime-only 46 | // https://vuejs.org/v2/guide/installation.html 47 | render: (h) => h(App), 48 | }); 49 | }); 50 | } else { 51 | /* eslint-disable no-new */ 52 | new Vue({ 53 | el: '#app', 54 | router, 55 | // use Runtime-only 56 | // https://vuejs.org/v2/guide/installation.html 57 | render: (h) => h(App), 58 | }); 59 | } 60 | <%_ } else { _%> 61 | /* eslint-disable no-new */ 62 | new Vue({ 63 | el: '#app', 64 | router, 65 | // use Runtime-only 66 | // https://vuejs.org/v2/guide/installation.html 67 | render: (h) => h(App) 68 | }); 69 | <%_ } _%> 70 | -------------------------------------------------------------------------------- /generator/template-base/public/console.js: -------------------------------------------------------------------------------- 1 | // 移动端调试工具 2 | if (window.LOCAL_CONFIG.IS_OPEN_VCONSOLE) { 3 | function dynamicLoadScript(src, callback, options) { 4 | var existingScript = document.getElementById(src); 5 | var cb = callback || function () {}; 6 | 7 | if (!existingScript) { 8 | var script = document.createElement('script'); 9 | script.src = src; // src url for the third-party library being loaded. 10 | script.id = options.id || src; 11 | if (options.crossorigin) { 12 | script.crossorigin = options.crossorigin; 13 | } 14 | if (options.async) { 15 | script.async = options.async; 16 | } 17 | if (options.defer) { 18 | script.defer = options.defer; 19 | } 20 | 21 | document.body.appendChild(script); 22 | 23 | var onEnd = 'onload' in script ? stdOnEnd : ieOnEnd; 24 | onEnd(script, cb); 25 | } 26 | 27 | if (existingScript && cb) cb(null, existingScript); 28 | 29 | function stdOnEnd(script, cb) { 30 | script.onload = function () { 31 | // this.onload = null here is necessary 32 | // because even IE9 works not like others 33 | this.onerror = this.onload = null; 34 | cb(null, script); 35 | }; 36 | script.onerror = function () { 37 | this.onerror = this.onload = null; 38 | cb(new Error('Failed to load ' + src), script); 39 | }; 40 | } 41 | 42 | function ieOnEnd(script, cb) { 43 | script.onreadystatechange = function () { 44 | if (this.readyState !== 'complete' && this.readyState !== 'loaded') 45 | return; 46 | this.onreadystatechange = null; 47 | cb(null, script); // there is no way to catch loading errors in IE8 48 | }; 49 | } 50 | } 51 | 52 | dynamicLoadScript( 53 | './vconsole.min.js', 54 | function (err) { 55 | if (err) { 56 | console.error('加载 vconsole.min.js 出现异常'); 57 | return; 58 | } 59 | try { 60 | var vConsole = new VConsole(); 61 | vConsole.setOption({ maxLogNumber: 5000 }); 62 | console.log('当前 url', window.location.href); 63 | } catch (err) { 64 | console.error('new VConsole() 出现异常'); 65 | } 66 | }, 67 | { async: true } 68 | ); 69 | } 70 | -------------------------------------------------------------------------------- /generator/miniprogram/src/services/request.ts: -------------------------------------------------------------------------------- 1 | import { request, showToast } from '@tarojs/taro'; 2 | import { CODE_MESSAGE } from '@/constants/status'; 3 | import autoMatchBaseUrl from './autoMatchBaseUrl'; 4 | 5 | type RequestOpts = Omit; 6 | 7 | // 检测请求状态 8 | const checkStatusAndFilter = (response) => { 9 | if (response.statusCode >= 200 && response.statusCode < 300) { 10 | if (response.statusCode === 200 || response.statusCode === 304) { 11 | return response.data; 12 | } 13 | return response; 14 | } 15 | // 除此之外的错所有遍历上面的错误信息抛出异常 16 | const errorText = CODE_MESSAGE[response.statusCode] || response.errMsg; 17 | 18 | showToast({ 19 | title: errorText, 20 | mask: true, 21 | icon: 'none', 22 | duration: 2000 23 | }); 24 | 25 | return Promise.reject(response); 26 | }; 27 | 28 | const safeRequest = (url: string, options: RequestOpts) => { 29 | const newURL = url.indexOf('http') !== -1 ? url : autoMatchBaseUrl(url); 30 | 31 | return new Promise((resolve, reject) => { 32 | request({ 33 | method: 'GET', 34 | ...options, 35 | header: { 36 | 'Content-Type': 'application/json', 37 | ...options?.header 38 | }, 39 | url: newURL 40 | }).then( 41 | (response) => { 42 | const data = checkStatusAndFilter(response); 43 | resolve(data); 44 | }, 45 | (err) => { 46 | reject(err); 47 | } 48 | ); 49 | }); 50 | }; 51 | 52 | /** 53 | * get 54 | * @param url 55 | * @param opts 56 | * @returns {Promise} 57 | */ 58 | const get = async (url: string, opts: RequestOpts): Promise => { 59 | return safeRequest(url, opts); 60 | }; 61 | 62 | /** 63 | * post 64 | * @param url 65 | * @param opts 66 | * @returns {Promise} 67 | */ 68 | const post = async (url: string, opts: RequestOpts): Promise => { 69 | return safeRequest(url, { 70 | ...opts, 71 | method: 'POST' 72 | }); 73 | }; 74 | 75 | /** 76 | * put 77 | * @param url 78 | * @param opts 79 | * @returns {Promise} 80 | */ 81 | const put = async (url: string, opts: RequestOpts): Promise => { 82 | return safeRequest(url, { 83 | ...opts, 84 | method: 'PUT' 85 | }); 86 | }; 87 | 88 | export default { 89 | get, 90 | post, 91 | put, 92 | safeRequest 93 | }; 94 | -------------------------------------------------------------------------------- /generator/miniprogram/src/utils/log.ts: -------------------------------------------------------------------------------- 1 | // log输出级别分为五种:debug,info,warn,error,fatal。 2 | import Taro from '@tarojs/taro'; 3 | import { customFormatDate } from './index'; 4 | import { stringify } from './serialize'; 5 | 6 | /** 7 | * (信息)在粗粒度级别上突出强调应用程序的运行过程,打印一些感兴趣的或者重要的信息。 8 | * @param {string} name 错误名字 9 | * @param {Object} option 可选 一般信息 10 | */ 11 | export const info = (name, option) => { 12 | option = stringify(option); 13 | report(name, option, 'info'); 14 | }; 15 | 16 | /** 17 | * (警告)表明会出现潜在错误的情形,有些信息不是错误信息,但是也要上报一些提示。 18 | * @param {string} name 错误名字 19 | * @param {Object} option 错误信息,通常是 fail 返回的 20 | */ 21 | export const warn = (name, option) => { 22 | option = stringify(option); 23 | report(name, option, 'warn'); 24 | }; 25 | 26 | /** 27 | * (调试)指出细粒度信息事件对调试应用程序是非常有帮助的,主要用于开发过程中打印一些运行信息。 28 | * @param {string} name 错误名字 29 | * @param {string} message 错误信息 30 | * @param {Objec} option 可选 一般信息 31 | */ 32 | export const debug = (name, option) => { 33 | // todo: 之后增加详细调用 stack 34 | option = stringify(option); 35 | report(name, option, 'debug'); 36 | }; 37 | 38 | /** 39 | *(错误)指出虽然发生错误事件,但仍然不影响系统的继续运行。 40 | * @param {string} name 错误名字 41 | * @param {Object} option 错误信息,通常是 fail 返回的 42 | */ 43 | export const error = (name, option) => { 44 | option = stringify(option); 45 | report(name, option, 'error'); 46 | }; 47 | 48 | /** 49 | * (致命)指出每个严重的错误事件将会导致应用程序的退出。 50 | * @param {string} name 错误名字 51 | * @param {Object} option 错误信息,通常是 fail 返回的 52 | */ 53 | export const fatal = (name, option) => { 54 | option = stringify(option); 55 | report(name, option, 'fatal'); 56 | }; 57 | 58 | const report = (name, option, type = 'info') => { 59 | let deviceInfo; 60 | let device = ''; 61 | try { 62 | deviceInfo = Taro.getSystemInfoSync(); 63 | device = JSON.stringify(deviceInfo); 64 | } catch (e) { 65 | console.error('not support getSystemInfoSync api', e.message); 66 | } 67 | let time = customFormatDate(Date.now() / 1000); 68 | // let user = getApp().globalData.user 69 | if (type == 'info') { 70 | console.log(time, name, option, device); 71 | } else { 72 | console.error(time, name, option, device); 73 | } 74 | // getApp().globalData.elkReport.send({ message: { type,time, name, option, user, deviceInfo }, status: 500 }) 75 | }; 76 | 77 | export default { debug, info, warn, error, fatal }; 78 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/icons/svg/cat.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /generator/template-vue2/src/icons/svg/cat.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/icons/svg/cat.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/icons/svg/cat.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /generator/template-vue3-ts/src/icons/svg/cat.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /generator/template-vue3/src/icons/svg/cat.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/main.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/stable'; 2 | import 'regenerator-runtime/runtime'; 3 | <%_ if ((options.application === 'mobile' || options.application === 'offline') && options['layout-adapter'] !== 'vw') { _%> 4 | import 'amfe-flexible'; 5 | <%_ } _%> 6 | import Vue from 'vue'; 7 | import Component from 'vue-class-component'; 8 | import App from './App.vue'; 9 | import router from './router'; 10 | import './icons'; 11 | import './router/router.interceptor'; 12 | import './filters'; 13 | import './services'; 14 | import './bus'; 15 | import './pwa/register-service-worker'; 16 | <%_ if (options['ui-framework'] === 'element-ui') { _%> 17 | import './vendor/element'; 18 | <%_ } else if (options['ui-framework'] === 'iview') { _%> 19 | import './vendor/iview'; 20 | <%_ } else if (options['ui-framework'] === 'ant') { _%> 21 | import './vendor/ant'; 22 | <%_ } else if (options['ui-framework'] === 'hui') { _%> 23 | import './vendor/hui'; 24 | <%_ } else if (options['mobile-ui-framework'] === 'vant') { _%> 25 | import './vendor/vant'; 26 | <%_ } else if (options['mobile-ui-framework'] === 'wui') { _%> 27 | import './vendor/wui'; 28 | <%_ } _%> 29 | <%_ if (options.application === 'offline') { _%> 30 | import {isLightOS, nativeReady} from '@winner-fed/native-bridge-methods'; 31 | import LightSDK from 'light-sdk/dist/index.umd'; 32 | 33 | window.LightSDK = LightSDK; 34 | <%_ } _%> 35 | 36 | import './assets/style/app.less'; 37 | 38 | // 注册钩子函数 39 | Component.registerHooks([ 40 | 'beforeRouteEnter', 41 | 'beforeRouteLeave', 42 | 'beforeRouteUpdate' 43 | ]); 44 | 45 | Vue.config.productionTip = process.env.NODE_ENV === 'production'; 46 | 47 | <%_ if (options.application === 'offline') { _%> 48 | if (isLightOS()) { 49 | nativeReady().then(() => { 50 | new Vue({ 51 | el: '#app', 52 | router, 53 | // use Runtime-only 54 | // https://vuejs.org/v2/guide/installation.html 55 | render: (h) => h(App), 56 | }); 57 | }); 58 | } else { 59 | /* eslint-disable no-new */ 60 | new Vue({ 61 | el: '#app', 62 | router, 63 | // use Runtime-only 64 | // https://vuejs.org/v2/guide/installation.html 65 | render: (h) => h(App), 66 | }); 67 | } 68 | <%_ } else { _%> 69 | /* eslint-disable no-new */ 70 | new Vue({ 71 | el: '#app', 72 | router, 73 | // use Runtime-only 74 | // https://vuejs.org/v2/guide/installation.html 75 | render: (h) => h(App) 76 | }); 77 | <%_ } _%> 78 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/main.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/stable'; 2 | import 'regenerator-runtime/runtime'; 3 | <%_ if ((options.application === 'mobile' || options.application === 'offline') && options['layout-adapter'] !== 'vw') { _%> 4 | import 'amfe-flexible'; 5 | <%_ } _%> 6 | import Vue from 'vue'; 7 | import Component from 'vue-class-component'; 8 | import App from './App.vue'; 9 | import router from './router'; 10 | import './icons'; 11 | import './router/router.interceptor'; 12 | import './filters'; 13 | import './services'; 14 | import './bus'; 15 | import './pwa/register-service-worker'; 16 | <%_ if (options['ui-framework'] === 'element-ui') { _%> 17 | import './vendor/element'; 18 | <%_ } else if (options['ui-framework'] === 'iview') { _%> 19 | import './vendor/iview'; 20 | <%_ } else if (options['ui-framework'] === 'ant') { _%> 21 | import './vendor/ant'; 22 | <%_ } else if (options['ui-framework'] === 'hui') { _%> 23 | import './vendor/hui'; 24 | <%_ } else if (options['mobile-ui-framework'] === 'vant') { _%> 25 | import './vendor/vant'; 26 | <%_ } else if (options['mobile-ui-framework'] === 'wui') { _%> 27 | import './vendor/wui'; 28 | <%_ } _%> 29 | <%_ if (options.application === 'offline') { _%> 30 | import {isLightOS, nativeReady} from '@winner-fed/native-bridge-methods'; 31 | import LightSDK from 'light-sdk/dist/index.umd'; 32 | 33 | window.LightSDK = LightSDK; 34 | <%_ } _%> 35 | 36 | import './assets/style/app.less'; 37 | 38 | // 注册钩子函数 39 | Component.registerHooks([ 40 | 'beforeRouteEnter', 41 | 'beforeRouteLeave', 42 | 'beforeRouteUpdate' 43 | ]); 44 | 45 | Vue.config.productionTip = process.env.NODE_ENV === 'production'; 46 | 47 | <%_ if (options.application === 'offline') { _%> 48 | if (isLightOS()) { 49 | nativeReady().then(() => { 50 | new Vue({ 51 | el: '#app', 52 | router, 53 | // use Runtime-only 54 | // https://vuejs.org/v2/guide/installation.html 55 | render: (h) => h(App), 56 | }); 57 | }); 58 | } else { 59 | /* eslint-disable no-new */ 60 | new Vue({ 61 | el: '#app', 62 | router, 63 | // use Runtime-only 64 | // https://vuejs.org/v2/guide/installation.html 65 | render: (h) => h(App), 66 | }); 67 | } 68 | <%_ } else { _%> 69 | /* eslint-disable no-new */ 70 | new Vue({ 71 | el: '#app', 72 | router, 73 | // use Runtime-only 74 | // https://vuejs.org/v2/guide/installation.html 75 | render: (h) => h(App) 76 | }); 77 | <%_ } _%> 78 | -------------------------------------------------------------------------------- /generator/miniprogram/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // 设置url挂载参数 3 | export const setUrlQuery = (options) => { 4 | let { url, query } = options; 5 | if (!url) return ''; 6 | if (query) { 7 | let queryArr: string[] = []; 8 | for (const key in query) { 9 | if (query.hasOwnProperty(key)) { 10 | queryArr.push(`${key}=${query[key]}`); 11 | } 12 | } 13 | if (url.indexOf('?') !== -1) { 14 | url = `${url}&${queryArr.join('&')}`; 15 | } else { 16 | url = `${url}?${queryArr.join('&')}`; 17 | } 18 | } 19 | return url; 20 | }; 21 | 22 | /** 23 | * 获取url参数数据,返回obj对象 24 | */ 25 | export const getUrlToJson = (url) => { 26 | try { 27 | const strUrl = url || window?.location?.href || ''; 28 | let temp1 = strUrl.split('?'); 29 | let [_, pram] = temp1; 30 | if (pram === 'undefined' || !pram) { 31 | return {}; 32 | } 33 | let keyValue = pram.split('&'); 34 | let obj = {}; 35 | for (let i = 0; i < keyValue.length; i++) { 36 | let item = keyValue[i].split('='); 37 | let [key, value] = item; 38 | obj[key] = value; 39 | } 40 | return obj; 41 | } catch (error) { 42 | return {}; 43 | } 44 | }; 45 | 46 | /** 47 | * 通用时间格式转换,将时间戳转换自己需要的格式 48 | * 49 | * [fmt] 第二参数类型字符串,注意指定 50 | * 年(y)、月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) ,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) 51 | * 52 | * customFormatDate(时间戳, "yyyy-MM-dd hh:mm:ss.S") 转换后 2016-07-02 08:09:04.423 53 | */ 54 | export const customFormatDate = (UnixTime, fmt?: string) => { 55 | if (!UnixTime) return ''; 56 | const dateTime = new Date(parseInt(`${UnixTime * 1000}`)); 57 | const o = { 58 | 'M+': dateTime.getMonth() + 1, //月份 59 | 'd+': dateTime.getDate(), //日 60 | 'h+': dateTime.getHours(), //小时 61 | 'm+': dateTime.getMinutes(), //分 62 | 's+': dateTime.getSeconds(), //秒 63 | 'q+': Math.floor((dateTime.getMonth() + 3) / 3), //季度 64 | S: dateTime.getMilliseconds() //毫秒 65 | }; 66 | let newDataStrin = fmt || 'yyyy-MM-dd hh:mm:ss.S'; 67 | if (/(y+)/.test(newDataStrin)) { 68 | newDataStrin = newDataStrin.replace( 69 | RegExp.$1, 70 | (dateTime.getFullYear() + '').substr(4 - RegExp.$1.length) 71 | ); 72 | } 73 | for (let k in o) { 74 | if (new RegExp('(' + k + ')').test(newDataStrin)) { 75 | newDataStrin = newDataStrin.replace( 76 | RegExp.$1, 77 | RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length) 78 | ); 79 | } 80 | } 81 | return newDataStrin; 82 | }; 83 | -------------------------------------------------------------------------------- /generator/template-vue2/src/icons/components/cat.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* tslint:disable */ 3 | // @ts-ignore 4 | import icon from 'vue-svgicon'; 5 | icon.register({ 6 | cat: { 7 | width: 226.172, 8 | height: 200, 9 | viewBox: '0 0 1158 1024', 10 | data: 11 | '' 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/icons/components/cat.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* tslint:disable */ 3 | // @ts-ignore 4 | import icon from 'vue-svgicon'; 5 | icon.register({ 6 | cat: { 7 | width: 226.172, 8 | height: 200, 9 | viewBox: '0 0 1158 1024', 10 | data: 11 | '' 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/icons/components/cat.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* tslint:disable */ 3 | // @ts-ignore 4 | import icon from 'vue-svgicon'; 5 | icon.register({ 6 | cat: { 7 | width: 226.172, 8 | height: 200, 9 | viewBox: '0 0 1158 1024', 10 | data: 11 | '' 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/icons/components/cat.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* tslint:disable */ 3 | // @ts-ignore 4 | import icon from 'vue-svgicon'; 5 | icon.register({ 6 | cat: { 7 | width: 226.172, 8 | height: 200, 9 | viewBox: '0 0 1158 1024', 10 | data: 11 | '' 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /generator/template-vue2-ts/src/pwa/components/ServiceWorkerUpdatePopup.vue: -------------------------------------------------------------------------------- 1 | 69 | 70 | 76 | -------------------------------------------------------------------------------- /generator/template-vue2-ts-vite/src/pwa/components/ServiceWorkerUpdatePopup.vue: -------------------------------------------------------------------------------- 1 | 69 | 70 | 76 | -------------------------------------------------------------------------------- /generator/template-vue2/src/components/SendCode/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 74 | 75 | 107 | -------------------------------------------------------------------------------- /generator/template-vue2-vite/src/components/SendCode/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 74 | 75 | 107 | --------------------------------------------------------------------------------