Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 59f7d23

Browse files
committed
rename example & improve code
1 parent bd77d2c commit 59f7d23

File tree

3 files changed

+13
-23
lines changed

3 files changed

+13
-23
lines changed

‎multipleforms/app.vue renamed to ‎grouping/app.vue

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<template lang="html">
22
<form>
3-
<vue-form-generator :schema="section1" :model="model" :options="formOptions"></vue-form-generator>
4-
<vue-form-generator :schema="section2" :model="model" :options="formOptions"></vue-form-generator>
3+
<vue-form-generator :schema="schema" :model="model" :options="formOptions"></vue-form-generator>
54
<pre>{{ model }}</pre>
65
</form>
76
</template>
@@ -15,12 +14,14 @@ export default {
1514
model: {
1615
name: 'Brian Blessed',
1716
email: "brian@hawkman.mongo",
18-
more: "More",
19-
things: "Things",
20-
pref_1: 'blah'
17+
others: {
18+
more: "More",
19+
things: "Things"
20+
},
21+
single: 'blah'
2122
},
2223
23-
section1: {
24+
schema: {
2425
groups:[{
2526
legend: "Contact Details",
2627
fields: [
@@ -44,39 +45,28 @@ export default {
4445
type: "input",
4546
inputType: "text",
4647
label: "More",
47-
model: "more"
48+
model: "others.more"
4849
},
4950
{
5051
type: "input",
5152
inputType: "text",
5253
label: "Things",
53-
model: "things"
54+
model: "others.things"
5455
}
5556
]
5657
}],
5758
fields: [
5859
{
5960
type: "input",
6061
inputType: "text",
61-
label: "Pref 1 (without group)",
62-
model: "pref_1"
63-
}
64-
]
65-
},
66-
67-
section2: {
68-
fields: [
69-
{
70-
type: "input",
71-
inputType: "text",
72-
label: "Pref 1",
73-
model: "pref_1"
62+
label: "Single field (without group)",
63+
model: "single"
7464
}
7565
]
7666
},
7767
7868
formOptions: {
79-
fieldIdPrefix: 'frm1_'
69+
fieldIdPrefix: 'frm1-'
8070
}
8171
}
8272
},

‎multipleforms/index.html renamed to ‎grouping/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
<body>
88
<div class="container-fluid"></div>
99
<div id="app"></div>
10-
<script src="/mforms.js"></script>
10+
<script src="/grouping.js"></script>
1111
</body>
1212
</html>
File renamed without changes.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /