Skip to content

Commit 54e2df1

Browse files
committed
🎨 update example
remove logo.png and update schema
1 parent 3f091f8 commit 54e2df1

File tree

4 files changed

+20
-25
lines changed

4 files changed

+20
-25
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import JsonEditor from '../../src/JsonEditor.vue';
3838
export default {
3939
components: { JsonEditor },
4040
data: () => ({
41-
// init json schma file
41+
// init json schma file ( require('@/schema/newsletter') )
4242
schema: SCHEMA,
4343
// data
4444
model: {
@@ -58,6 +58,9 @@ export default {
5858
</script>
5959
```
6060

61+
More info on: [Example-Subscription](example/components/Subscription.vue)
62+
Schema: [newsletter.json](example/schema/newsletter.json)
63+
6164
## props
6265

6366
- `schema` ***Object*** (*required*)

example/assets/logo.png

-6.69 KB
Binary file not shown.

example/components/Subscription.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,22 @@
99
</el-card>
1010
</el-col>
1111
<el-col :span="12">
12-
<el-card class="box-card">
12+
<el-card class="box-card">
1313
<div slot="header" class="clearfix">
1414
<span>Model</span>
1515
</div>
1616
<pre class="json">{{ jsonString }}</pre>
1717
</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>
1828
</el-col>
1929
</el-row>
2030
</template>

example/schema/newsletter.json

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,19 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"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 ",
66
"properties": {
77
"name": {
88
"type": "string",
99
"minLength": 8,
1010
"maxLength": 80,
11-
"title": "Full Name",
11+
"title": "String",
1212
"attrs": {
1313
"placeholder": "Your Full Name",
1414
"title": "Please enter your full name"
1515
}
1616
},
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-
},
2717
"sub": {
2818
"title": "SubTitle",
2919
"description": "SubDescription",
@@ -52,19 +42,15 @@
5242
"title": "Sub2Name",
5343
"pattern": "*"
5444
},
55-
"sEmail2": {
56-
"format": "email",
57-
"title": "Sub2Email"
58-
},
5945
"sAge": {
6046
"type": "integer",
61-
"title": "Sub2Email"
47+
"title": "Sub2Age"
6248
}
6349
},
6450
"required": [ "sName2" ]
6551
}
6652
},
67-
"required": ["sEmail"]
53+
"required": ["sUrl"]
6854
},
6955
"lists": {
7056
"type": "string",
@@ -95,10 +81,6 @@
9581
{ "value": "promotion", "label": "Promotion" }
9682
]
9783
},
98-
"lists4": {
99-
"type": "array",
100-
"title": "List4"
101-
},
10284
"source": {
10385
"type": "string",
10486
"maxLength": 120,

0 commit comments

Comments
 (0)