Skip to content

Commit 35bb03a

Browse files
committed
init
1 parent a1ddd3b commit 35bb03a

Some content is hidden

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

70 files changed

+25683
-1
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.eslintrc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"root": true,
3+
"parserOptions": {
4+
"parser": "babel-eslint"
5+
},
6+
"env": {
7+
"browser": true,
8+
"node": true,
9+
"es6": true
10+
},
11+
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
12+
"extends": ["plugin:vue/essential", "standard"],
13+
// required to lint *.vue files
14+
"plugins": ["import", "vue", "html"],
15+
// add your custom rules here
16+
"rules": {
17+
"camelcase": [0, { "properties": "never" }],
18+
"no-new": 0,
19+
"no-new-func": 0,
20+
"no-param-reassign": 0,
21+
"generator-star-spacing": "off",
22+
"no-tabs": "off",
23+
"vue/no-parsing-error": [2, { "x-invalid-end-tag": false }],
24+
"space-before-function-paren": 0,
25+
"object-curly-spacing": 0,
26+
"semi": ["error", "always"],
27+
"no-console": 0,
28+
"no-debugger": 0,
29+
"no-useless-escape": "off",
30+
"no-return-assign": "off",
31+
"no-proto": "off",
32+
"prefer-promise-reject-errors": "off",
33+
"import/no-duplicates": "off"
34+
},
35+
"globals": {
36+
"$ENV": true
37+
}
38+
}

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
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+
pnpm-debug.log*
15+
.history
16+
17+
# Editor directories and files
18+
.idea
19+
.vscode
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npm.taobao.org

.prettierrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"trailingComma": "none",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true,
6+
"htmlWhitespaceSensitivity": "ignore",
7+
"arrowParens": "avoid",
8+
"bracketSpacing": true
9+
}

README.md

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,80 @@
11
# vue-json-form
2-
基于Vue2,使用JSON配置表单,方便快捷。
2+
base on Vue2
3+
4+
## How to use
5+
`npm install git+ssh://git@github.com:springalskey/vue-json-form.git --save`
6+
7+
## Project setup
8+
9+
```
10+
npm install
11+
```
12+
13+
### Project start
14+
15+
```
16+
npm start
17+
```
18+
19+
### NodeJs Version
20+
21+
12.7.0
22+
23+
## Demo
24+
25+
```html
26+
<vue-json-form v-model="formData" :list="list" vid="vid-test"></vue-json-form>
27+
<el-button vid="vid-test" v-onsubmit="onSave" type="primary">保存</el-button>
28+
```
29+
```js
30+
export default {
31+
data() {
32+
return {
33+
formData: {
34+
color: '#F0F0F0'
35+
},
36+
list: [
37+
{
38+
type: 'color',
39+
label: '颜色',
40+
field: 'color',
41+
rules: { required: true }
42+
},
43+
{
44+
type: 'input-number',
45+
label: '购买数量',
46+
field: 'buyCount',
47+
rules: { required: true }
48+
},
49+
{
50+
type: 'radio',
51+
label: '活动类型',
52+
field: 'type',
53+
rules: { required: true },
54+
options: [
55+
{ label: '单品活动', value: 1 },
56+
{ label: '满减活动', value: 2 }
57+
]
58+
},
59+
{
60+
type: 'switch',
61+
label: '是否显示',
62+
field: 'isShow',
63+
rules: { required: true },
64+
// vif control showOrHide
65+
vif: (formData) => formData.type === 1
66+
},
67+
]
68+
};
69+
},
70+
methods: {
71+
async onSave(valided) {
72+
if (!valided) return;
73+
// 校验通过TOTO:
74+
}
75+
}
76+
};
77+
```
78+
79+
## 其他
80+
如果您对这个项目敢兴趣,请给个小星星哦。另外,如果需要更高级的功能,(可以查看)[https://zhizhi.info]

babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

env/env.dev.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
env: 'dev',
3+
routerBase: '/',
4+
publicPath: '/',
5+
};

env/env.prod.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
env: 'prod',
3+
routerBase: '/',
4+
publicPath: '/',
5+
};

0 commit comments

Comments
 (0)