Skip to content

Commit a4d65db

Browse files
committed
feat(vue3-core): 完成 @lljj/vue3-form-element package,更新文档
re #27 ci(workflow): 更新workflow
1 parent d821842 commit a4d65db

File tree

180 files changed

+30946
-8492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+30946
-8492
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Deploy docs
2+
3+
on:
4+
push:
5+
branches: [ master-dev ]
6+
7+
jobs:
8+
build-and-deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout # checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Setup node
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: "12.x"
19+
20+
- name: Install yarn
21+
run: npm install -g yarn
22+
23+
- name: Build
24+
run: |
25+
yarn install
26+
yarn run demo:build
27+
yarn run demo3:build
28+
29+
- name: Setup aliyun oss
30+
# 设置阿里云OSS配置
31+
uses: manyuanrong/setup-ossutil@v2.0
32+
with:
33+
endpoint: "oss-cn-hongkong.aliyuncs.com"
34+
access-key-id: ${{ secrets.OSS_ACCESSKEYID }}
35+
access-key-secret: ${{ secrets.OSS_ACCESSKEYSECRET }}
36+
37+
- name: Deploy demo-v2
38+
# 发布demo-v2
39+
run: ossutil cp -rf ./packages/demo/demo-v2/dist/ oss://dev-form/
40+
41+
- name: Deploy demo-v3
42+
# 发布demo-v3
43+
run: ossutil cp -rf ./packages/demo/demo-v3/dist/v3 oss://dev-form/v3

.github/workflows/docs-demo.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
yarn install
2323
yarn run docs:build
2424
yarn run demo:build
25+
yarn run demo3:build
2526
2627
- name: Setup aliyun oss
2728
# 设置阿里云OSS配置
@@ -38,3 +39,7 @@ jobs:
3839
- name: Deploy demo
3940
# 发布demo
4041
run: ossutil cp -rf ./packages/demo/demo-v2/dist/ oss://form-buhuida/
42+
43+
- name: Deploy demo-v3
44+
# 发布demo-v3
45+
run: ossutil cp -rf ./packages/demo/demo-v3/dist/v3 oss://form-buhuida/v3

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
# vue-json-schema-form
2-
* 基于 `Vue``ElementUi``JSON Schema` 动态生成一个带完整校验的Form表单
3-
* 支持通过 [可视化Schema编辑器](https://form.lljj.me/schema-generator.html "Vue JSON Schema Form 可视化编辑器") 快速生成表单对应Schema
4-
* :star2: :star2: :star2: 你的 `star` 就是最大的支持
1+
## vue-json-schema-form
52

6-
## 快速体验
7-
* [查看文档](https://vue-json-schema-form.lljj.me/ "Vue JSON Schema Docs")
8-
* [Playground 演示](https://form.lljj.me/ "Vue JSON Schema Form Demo") / [可视化表单Schema编辑器](https://form.lljj.me/schema-generator.html "Vue JSON Schema Form 可视化编辑器") / [可视化活动编辑器](https://form.lljj.me/vue-editor.html)
3+
基于 Vue2 / Vue3、 [JSON Schema](https://json-schema.org/understanding-json-schema/index.html) 生成带完整校验的Form表单,你的 :star2: :star2: :star2: 就是最大的支持
94

10-
> 查看如何启动 [Playground,表单Schema生成器,活动编辑器相关页面](#如何启动相关编辑器页面)
5+
[查看文档](https://vue-json-schema-form.lljj.me) - [Playground](https://form.lljj.me) - [可视化表单Schema生成器](https://form.lljj.me/schema-generator.html)
6+
7+
## ui框架支持
8+
* [vue2 ElementUi](https://github.com/lljj-x/vue-json-schema-form/tree/master/packages/lib/vue2/vue2-form-element)
9+
* [vue2 Iview3](https://github.com/lljj-x/vue-json-schema-form/tree/master/packages/lib/vue2/vue2-form-iview3)
10+
* [vue3 Element Plus](https://github.com/lljj-x/vue-json-schema-form/tree/master/packages/lib/vue3/vue3-form-element)
11+
* vue3 Antdv (todo)
1112

1213
![](https://lljj-xxxx.oss-cn-hongkong.aliyuncs.com/vue-json-schema-form.gif)
1314

@@ -55,8 +56,7 @@ yarn run demo:dev --dir=vue-editor
5556

5657
## 相关资料
5758
[JSON Schema](https://json-schema.org/understanding-json-schema/index.html) |
58-
[Vue](https://cn.vuejs.org/) |
59-
[Element Ui](https://element.eleme.io/)
59+
[Vue](https://cn.vuejs.org/)
6060

6161
### 为何开发
6262
在做前端可视化编辑时,为了解决数据配置表单的通用性,所以使用 `JSON Schema` 描述数据结构,动态生成表单。

package.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@
1212
"scripts": {
1313
"docs:dev": "yarn workspace docs dev",
1414
"docs:build": "yarn workspace docs build",
15-
"lib:watch": "yarn workspace @lljj/vue-json-schema-form watch",
16-
"lib:build": "yarn workspace @lljj/vue-json-schema-form build",
15+
"lib:build": "yarn lib-element:build && yarn lib-iview3:build && yarn lib3-element:build",
16+
"lib-element:watch": "yarn workspace @lljj/vue-json-schema-form watch",
17+
"lib-element:build": "yarn workspace @lljj/vue-json-schema-form build",
1718
"lib-iview3:watch": "yarn workspace @lljj/vue2-form-iview3 watch",
1819
"lib-iview3:build": "yarn workspace @lljj/vue2-form-iview3 build",
20+
"lib3-element:watch": "yarn workspace @lljj/vue3-form-element watch",
21+
"lib3-element:build": "yarn workspace @lljj/vue3-form-element build",
1922
"demo:dev": "yarn workspace demo dev",
2023
"demo:build": "yarn workspace demo build",
2124
"demo3:dev": "yarn workspace demo-v3 dev",
@@ -44,11 +47,12 @@
4447
"devDependencies": {
4548
"@commitlint/cli": "^8.3.5",
4649
"@commitlint/config-conventional": "^8.3.4",
50+
"@vue/compiler-sfc": "^3.0.0",
4751
"commitizen": "^4.1.2",
48-
"cz-conventional-changelog": "^3.2.0",
4952
"conventional-changelog-cli": "^2.0.34",
53+
"cz-conventional-changelog": "^3.2.0",
5054
"husky": "^4.2.5",
51-
"lerna": "^3.22.1",
52-
"@vue/compiler-sfc": "^3.0.0"
53-
}
55+
"lerna": "^3.22.1"
56+
},
57+
"version": "0.0.0"
5458
}

packages/demo/demo-common/components/CodeEditorV3.vue

Lines changed: 0 additions & 176 deletions
This file was deleted.

packages/demo/demo-common/components/EditorHeader.vue

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,29 @@
1515
</h1>
1616
<Menu
1717
:class="$style.menu"
18+
:version="version"
1819
v-bind="$attrs"
1920
></Menu>
2021
</div>
2122
<div :class="$style.btns">
23+
<el-select
24+
v-if="showVersion"
25+
:model-value="version"
26+
:value="version"
27+
placeholder="版本"
28+
size="small"
29+
style="margin-right: 6px;width: 84px;"
30+
@change="handleVersionChange"
31+
>
32+
<el-option
33+
value="vue2"
34+
label="vue2"
35+
></el-option>
36+
<el-option
37+
value="vue3"
38+
label="vue3"
39+
></el-option>
40+
</el-select>
2241
<slot></slot>
2342
</div>
2443
</div>
@@ -31,12 +50,35 @@ export default {
3150
name: 'EditorHeader',
3251
components: {
3352
Menu
53+
},
54+
props: {
55+
version: {
56+
default: 'vue2',
57+
type: String
58+
},
59+
showVersion: {
60+
default: false,
61+
type: Boolean
62+
}
63+
},
64+
methods: {
65+
handleVersionChange(val) {
66+
window.location.href = window.location.href.replace(
67+
`${window.location.origin}${val === 'vue3' ? '' : '/v3'}`,
68+
`${window.location.origin}${val === 'vue3' ? '/v3' : ''}`
69+
);
70+
},
3471
}
3572
};
3673
</script>
3774

3875
<style module>
3976
@import "../css/variable.css";
77+
.btns {
78+
display: flex;
79+
align-items: center;
80+
justify-content: center;
81+
}
4082
.box {
4183
position: relative;
4284
margin: 0 auto;

packages/demo/demo-common/components/Menu.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
></i>Playground
3333
</a>
3434
</el-menu-item>
35-
<el-menu-item index="3">
35+
<el-menu-item
36+
v-if="$attrs.version==='vue2'"
37+
index="3"
38+
>
3639
<a
3740
:class="$style.menuLink"
3841
href="/vue-editor.html#/editor"
@@ -43,7 +46,10 @@
4346
></i>活动编辑器
4447
</a>
4548
</el-menu-item>
46-
<el-menu-item index="4">
49+
<el-menu-item
50+
v-if="$attrs.version==='vue2'"
51+
index="4"
52+
>
4753
<a
4854
:class="$style.menuLink"
4955
href="/schema-generator.html#/index"

0 commit comments

Comments
 (0)