Commit f65e9be5658e3d61b6ae0e7276e90140814898f2
1 parent
578ca325
update checkboxGroup
update checkboxGroup
Showing
3 changed files
with
32 additions
and
1 deletions
Show diff stats
src/components/checkbox/checkbox-group.vue
src/components/checkbox/checkbox.vue
test/routers/form.vue
... | ... | @@ -30,6 +30,26 @@ |
30 | 30 | </Radio> |
31 | 31 | </Radio-group> |
32 | 32 | </form-item> |
33 | + <form-item label="checkbox-g" prop="checkboxgroup"> | |
34 | + <Checkbox-group :model.sync="form.checkboxgroup"> | |
35 | + <Checkbox value="twitter"> | |
36 | + <Icon type="social-twitter"></Icon> | |
37 | + <span>Twitter</span> | |
38 | + </Checkbox> | |
39 | + <Checkbox value="facebook"> | |
40 | + <Icon type="social-facebook"></Icon> | |
41 | + <span>Facebook</span> | |
42 | + </Checkbox> | |
43 | + <Checkbox value="github"> | |
44 | + <Icon type="social-github"></Icon> | |
45 | + <span>Github</span> | |
46 | + </Checkbox> | |
47 | + <Checkbox value="snapchat"> | |
48 | + <Icon type="social-snapchat"></Icon> | |
49 | + <span>Snapchat</span> | |
50 | + </Checkbox> | |
51 | + </Checkbox-group> | |
52 | + </form-item> | |
33 | 53 | <form-item> |
34 | 54 | <i-button type="primary" @click="onSubmit('form')">提交</i-button> |
35 | 55 | </form-item> |
... | ... | @@ -45,7 +65,8 @@ |
45 | 65 | mail: '', |
46 | 66 | passwd: '', |
47 | 67 | single: false, |
48 | - group: '' | |
68 | + group: '', | |
69 | + checkboxgroup: [] | |
49 | 70 | }, |
50 | 71 | rules: { |
51 | 72 | mail: [ |
... | ... | @@ -68,6 +89,14 @@ |
68 | 89 | { |
69 | 90 | required: true, message: '请单选组' |
70 | 91 | } |
92 | + ], | |
93 | + checkboxgroup: [ | |
94 | + { | |
95 | + required: true, message: '至少选择2个', min: 2, type: 'array', | |
96 | + }, | |
97 | + { | |
98 | + required: true, message: '至多选择3个', max: 3, type: 'array' | |
99 | + } | |
71 | 100 | ] |
72 | 101 | } |
73 | 102 | } | ... | ... |