vite-vue3-lowcode/README.EN.md

131 lines
7.2 KiB
Markdown
Raw Permalink Normal View History

2021-06-12 22:19:59 +08:00
# base on Vite2.x + Vue3.x + TypeScript H5 Low code platform
2021-06-10 17:23:51 +08:00
[![license](https://img.shields.io/github/license/buqiyuan/vite-vue3-lowcode.svg)](LICENSE)
2021-06-12 22:19:59 +08:00
**English** | [中文](./README.md)
2021-06-10 17:23:51 +08:00
2021-06-12 22:19:59 +08:00
## Clone the main branch and ignore irrelevant branches such as git-pages
2021-06-10 17:23:51 +08:00
```shell
git clone --single-branch https://github.com/buqiyuan/vite-vue3-lowcode.git
```
2021-06-12 22:19:59 +08:00
## technology stack
- Programming Language[TypeScript 4.x](https://www.typescriptlang.org/zh/) + [JavaScript](https://www.javascript.com/)
- Build Tools[Vite 2.x](https://cn.vitejs.dev/)
- Front End Frame[Vue 3.x](https://v3.cn.vuejs.org/)
- Subnet Calculator[Vue Router 4.x](https://next.router.vuejs.org/zh/index.html)
- State Management[Vuex 4.x](https://next.vuex.vuejs.org/)
- PC UI Frame[Element Plus](https://element-plus.org/#/zh-CN)
- H5 UI Frame[vant](https://vant-contrib.gitee.io/vant/v3/#/zh-CN/)
- CSS Pre[Stylus](https://stylus-lang.com/) / [Sass](https://sass.bootcss.com/documentation) / [Less](http://lesscss.cn/)
- HTTP Tool[Axios](https://axios-http.com/)
2021-06-10 17:23:51 +08:00
- Git Hook 工具:[husky](https://typicode.github.io/husky/#/) + [lint-staged](https://github.com/okonet/lint-staged)
2021-06-12 22:19:59 +08:00
- Coding Standards[EditorConfig](http://editorconfig.org) + [Prettier](https://prettier.io/) + [ESLint](https://eslint.org/) + [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript#translation)
- Submit Specifications[Commitizen](http://commitizen.github.io/cz-cli/) + [Commitlint](https://commitlint.js.org/#/)
- Unit Testing[vue-test-utils](https://next.vue-test-utils.vuejs.org/) + [jest](https://jestjs.io/) + [vue-jest](https://github.com/vuejs/vue-jest) + [ts-jest](https://kulshekhar.github.io/ts-jest/)
- Auto Deploy[GitHub Actions](https://docs.github.com/cn/actions/learn-github-actions)
2021-06-10 17:23:51 +08:00
2021-06-12 22:19:59 +08:00
### Function List
2021-06-10 17:23:51 +08:00
2021-06-12 22:19:59 +08:00
- [x] Add pages dynamically
- [x] Drag and drop components
- [ ] service worker + indexeddb Implement server-free front-end interaction
- [ ] DataSource Admin Console
- [ ] Provide preset functions
- [ ] More component encapsulation
- [ ] Others...
2021-06-10 17:23:51 +08:00
2021-06-12 22:19:59 +08:00
### Generate component properties quickly
2021-06-10 17:23:51 +08:00
```javascript
// 在vant文档中 chrome控制台输入以下代码快速生成组件属性
let propObj = {
string: (config) => `createEditorInputProp(${JSON.stringify(config)})`,
number: (config) => `createEditorInputNumberProp(${JSON.stringify(config)})`,
boolean: (config) => `createEditorSwitchProp(${JSON.stringify(config)})`
}
2021-07-04 17:04:10 +08:00
JSON.stringify(
$$('#props + table tbody tr').reduce((prev, curr) => {
const children = curr.children
const key = children[0].textContent.replace(/-([a-z])/g, (all, i) => i.toUpperCase())
const child3Text = children[3].textContent
const defaultValue = ['true', 'false'].includes(child3Text)
? child3Text
: `'${child3Text == '-' ? '' : child3Text}'`
const value = (propObj[children[2].textContent] ?? propObj['string'])({
label: `'${children[1].textContent}'`,
defaultValue
}).replaceAll('"', '')
prev[key] = value
return prev
}, {})
).replaceAll('"', '')
2021-06-10 17:23:51 +08:00
```
```javascript
// 在vant文档中 chrome控制台输入以下代码快速生成组件事件
JSON.stringify(
$$('#events + table tbody tr').reduce((prev, curr) => {
const children = curr.children
const event = {
label: children[1].textContent,
value: children[0].textContent
}
return prev.concat([event])
}, [])
)
.replaceAll(/(?<!:)\"(?!,|})/g, '')
.replace(/\"/g, "'")
```
2021-06-12 22:19:59 +08:00
## Browser support
2021-06-10 17:23:51 +08:00
2021-06-12 22:19:59 +08:00
The `Chrome 80+` browser is recommended for local development
2021-06-10 17:23:51 +08:00
2021-06-12 22:19:59 +08:00
Support modern browsers, not IE
2021-06-10 17:23:51 +08:00
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
2021-06-12 22:19:59 +08:00
### Git Contribution submission specification
2021-06-10 17:23:51 +08:00
2021-06-12 22:19:59 +08:00
- `feat` Add new features
- `fix` Fix the problem/BUG
- `style` The code style is related and does not affect the running result
- `perf` Optimization/performance improvement
- `refactor` Refactor
- `revert` Undo edit
- `test` Test related
- `docs` Documentation/notes
- `chore` Dependency update/scaffolding configuration modification etc.
- `workflow` Workflow improvements
- `ci` Continuous integration
- `types` Type definition file changes
- `wip` In development
2021-06-10 17:23:51 +08:00
2021-06-12 22:19:59 +08:00
## QUICK START
2021-06-10 17:23:51 +08:00
2021-06-12 22:19:59 +08:00
### Install and use
2021-06-10 17:23:51 +08:00
```sh
npm install
# or
yarn add
```
2021-06-12 22:19:59 +08:00
### run
2021-06-10 17:23:51 +08:00
```sh
npm run dev
```
2021-06-12 22:19:59 +08:00
### build
2021-06-10 17:23:51 +08:00
```sh
npm run build
```