File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
docs/src/pages/components Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 325
325
</md-select >
326
326
</md-input-container >
327
327
</div >
328
-
328
+
329
329
<div >Selected users: {{ users }}</div >
330
+
330
331
</div >
331
332
332
333
<div slot =" code" >
Original file line number Diff line number Diff line change 60
60
watch: {
61
61
value (value ) {
62
62
this .setTextAndValue (value);
63
+ this .selectOptions (value);
63
64
},
64
65
disabled () {
65
66
this .setParentDisabled ();
81
82
setParentPlaceholder () {
82
83
this .parentContainer .hasPlaceholder = !! this .placeholder ;
83
84
},
85
+ selectOptions (modelValue ) {
86
+ const optionsArray = Object .keys (this .options ).map ((el ) => this .options [el]);
87
+
88
+ if (optionsArray && optionsArray .length ) {
89
+ optionsArray .filter ((el ) => modelValue .indexOf (el .value ) !== - 1 )
90
+ .forEach ((el ) => {
91
+ el .check = true ;
92
+ });
93
+ }
94
+ },
84
95
getSingleValue (value ) {
85
96
let output = {};
86
97
124
135
return {};
125
136
},
126
137
setTextAndValue (modelValue ) {
127
- const output = this .multiple ? this .getMultipleValue (modelValue) : this .getSingleValue (modelValue);
138
+ const output = this .multiple ?
139
+ this .getMultipleValue (modelValue) :
140
+ this .getSingleValue (modelValue);
128
141
129
142
this .selectedValue = output .value ;
130
143
this .selectedText = output .text ;
You can’t perform that action at this time.
0 commit comments