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 241eb0d

Browse files
committed
fix checklist validation bug #194
1 parent 6820077 commit 241eb0d

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

‎checklist/app.vue

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<template lang="html">
2+
<div>
3+
<vue-form-generator :schema="schema" :model="model" :options="formOptions"></vue-form-generator>
4+
<pre><code>{{ model }}</code></pre>
5+
</div>
6+
</template>
7+
8+
<script>
9+
import Vue from "vue";
10+
import { validators } from "../../src";
11+
12+
export default {
13+
data () {
14+
return {
15+
model: {
16+
skills: ["Javascript", "VueJS"]
17+
},
18+
19+
schema: {
20+
fields: [
21+
{
22+
type: "checklist",
23+
label: "Skills",
24+
model: "skills",
25+
required: true,
26+
min: 2,
27+
listBox: true,
28+
values: ["HTML5", "Javascript", "CSS3", "CoffeeScript", "AngularJS", "ReactJS", "VueJS"],
29+
validator: validators.array,
30+
onChanged(model) {
31+
console.log("skills changed to", model.skills);
32+
},
33+
onValidated(model, errors) {
34+
console.log("skills validated:", errors);
35+
}
36+
}
37+
]
38+
},
39+
40+
formOptions: {
41+
validateAfterChanged: true
42+
}
43+
}
44+
},
45+
46+
created() {
47+
window.app = this;
48+
}
49+
}
50+
</script>

‎checklist/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>vue-form-generator multiselect demo</title>
6+
</head>
7+
<body>
8+
<div class="container-fluid"></div>
9+
<div id="app"></div>
10+
<script src="/checklist.js"></script>
11+
</body>
12+
</html>

‎checklist/main.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Vue from "vue";
2+
import VueFormGenerator from "../../src";
3+
Vue.use(VueFormGenerator);
4+
5+
import App from './app.vue';
6+
7+
new Vue({
8+
...App
9+
}).$mount('#app');

0 commit comments

Comments
(0)

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