File tree Expand file tree Collapse file tree 4 files changed +20
-25
lines changed Expand file tree Collapse file tree 4 files changed +20
-25
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ import JsonEditor from '../../src/JsonEditor.vue';
38
38
export default {
39
39
components: { JsonEditor },
40
40
data: () => ({
41
- // init json schma file
41
+ // init json schma file ( require('@/schema/newsletter') )
42
42
schema: SCHEMA,
43
43
// data
44
44
model: {
@@ -58,6 +58,9 @@ export default {
58
58
</script>
59
59
```
60
60
61
+ More info on: [ Example-Subscription] ( example/components/Subscription.vue )
62
+ Schema: [ newsletter.json] ( example/schema/newsletter.json )
63
+
61
64
## props
62
65
63
66
- ` schema ` *** Object*** (* required* )
Original file line number Diff line number Diff line change 9
9
</el-card >
10
10
</el-col >
11
11
<el-col :span =" 12" >
12
- <el-card class =" box-card" >
12
+ <el-card class =" box-card" >
13
13
<div slot =" header" class =" clearfix" >
14
14
<span >Model</span >
15
15
</div >
16
16
<pre class =" json" >{{ jsonString }}</pre >
17
17
</el-card >
18
+ <br />
19
+ <el-card class =" box-card" >
20
+ <div slot =" header" class =" clearfix" >
21
+ <span >How to use</span >
22
+ </div >
23
+ <div class =" json" >
24
+ <p >GitHub: <a href =" https://github.com/yourtion/vue-json-ui-editor" target =" _blank" >vue-json-ui-editor</a ></p >
25
+ <p >NPM: <a href =" https://www.npmjs.com/package/vue-json-ui-editor" target =" _blank" >json-editor</a ></p >
26
+ </div >
27
+ </el-card >
18
28
</el-col >
19
29
</el-row >
20
30
</template >
Original file line number Diff line number Diff line change 1
1
{
2
2
"$schema" : " http://json-schema.org/draft-07/schema#" ,
3
3
"type" : " object" ,
4
- "title" : " Newsletter Subscription " ,
5
- "description" : " Sign up for free newsletters and get more delivered to your inbox " ,
4
+ "title" : " Json-Editor-Demo " ,
5
+ "description" : " Demo for vue-json-ui-editor using element-ui " ,
6
6
"properties" : {
7
7
"name" : {
8
8
"type" : " string" ,
9
9
"minLength" : 8 ,
10
10
"maxLength" : 80 ,
11
- "title" : " Full Name " ,
11
+ "title" : " String " ,
12
12
"attrs" : {
13
13
"placeholder" : " Your Full Name" ,
14
14
"title" : " Please enter your full name"
15
15
}
16
16
},
17
- "email" : {
18
- "maxLength" : 120 ,
19
- "title" : " Email" ,
20
- "format" : " email" ,
21
- "attrs" : {
22
- "type" : " email" ,
23
- "placeholder" : " Your Email" ,
24
- "title" : " Please enter your email"
25
- }
26
- },
27
17
"sub" : {
28
18
"title" : " SubTitle" ,
29
19
"description" : " SubDescription" ,
52
42
"title" : " Sub2Name" ,
53
43
"pattern" : " *"
54
44
},
55
- "sEmail2" : {
56
- "format" : " email" ,
57
- "title" : " Sub2Email"
58
- },
59
45
"sAge" : {
60
46
"type" : " integer" ,
61
- "title" : " Sub2Email "
47
+ "title" : " Sub2Age "
62
48
}
63
49
},
64
50
"required" : [ " sName2" ]
65
51
}
66
52
},
67
- "required" : [" sEmail " ]
53
+ "required" : [" sUrl " ]
68
54
},
69
55
"lists" : {
70
56
"type" : " string" ,
95
81
{ "value" : " promotion" , "label" : " Promotion" }
96
82
]
97
83
},
98
- "lists4" : {
99
- "type" : " array" ,
100
- "title" : " List4"
101
- },
102
84
"source" : {
103
85
"type" : " string" ,
104
86
"maxLength" : 120 ,
You can’t perform that action at this time.
0 commit comments