File tree 3 files changed +60
-1
lines changed
3 files changed +60
-1
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,35 @@ module.exports = {
77
77
hint : "Minimum 6 characters" ,
78
78
styleClasses : "half-width" ,
79
79
validator : validators . string
80
+ } ,
81
+
82
+ {
83
+ type : "vueMultiSelect" ,
84
+ label : "Skills (vue-multiSelect field)" ,
85
+ model : "skills" ,
86
+ multi : true ,
87
+ required : true ,
88
+ multiSelect : true ,
89
+ selectOptions : {
90
+ // https://silviomoreto.github.io/bootstrap-select/options/
91
+ liveSearch : true ,
92
+ //maxOptions: 3,
93
+ //size: 4,
94
+ //actionsBox: true,
95
+ selectedTextFormat : "count > 3"
96
+ } ,
97
+ values : [
98
+ "HTML5" ,
99
+ "Javascript" ,
100
+ "CSS3" ,
101
+ "CoffeeScript" ,
102
+ "AngularJS" ,
103
+ "ReactJS" ,
104
+ "VueJS"
105
+ ] ,
106
+ min : 2 ,
107
+ max : 4 ,
108
+ validator : validators . array
80
109
} ,
81
110
82
111
{
Original file line number Diff line number Diff line change 95
95
},
96
96
"dependencies" : {
97
97
"babel-runtime" : " 6.9.2" ,
98
- "vue" : " 1.0.24"
98
+ "vue" : " 1.0.24" ,
99
+ "vue-multiselect" : " ^1.0.1"
99
100
}
100
101
}
Original file line number Diff line number Diff line change
1
+ <template lang="jade">
2
+ multiselect( :selected="selected", :options="options", @update="updateSelected" )
3
+ </template >
4
+ <script >
5
+ import { isObject } from " lodash" ;
6
+ import abstractField from " ./abstractField" ;
7
+ import Multiselect from ' vue-multiselect' ;
8
+
9
+ export default {
10
+ mixins: [abstractField],
11
+ components: { Multiselect },
12
+ computed: {
13
+ options () {
14
+ let values = this .schema .values ;
15
+ if (typeof (values) == " function" ) {
16
+ return values .apply (this , [this .model , this .schema ]);
17
+ } else
18
+ return values;
19
+ }
20
+ },
21
+
22
+ methods: {
23
+ updateSelected (newSelected ) {
24
+ console .log (newSelected, this .selected )
25
+ this .selected = newSelected
26
+ }
27
+ }
28
+ };
29
+ </script >
You can’t perform that action at this time.
0 commit comments