File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,8 @@ export default {
145
145
}
146
146
const events = {
147
147
' update:model-value' : ((fieldId ) => (evt ) => {
148
- this .selected [fieldId] = evt
148
+ const selected = Array .from (evt).sort ((a , b ) => { return a > b ? 1 : - 1 })
149
+ this .selected [fieldId] = selected
149
150
})(field .id )
150
151
}
151
152
@@ -220,7 +221,7 @@ export default {
220
221
continue
221
222
}
222
223
const array = selected[field .id ]
223
- const str = multiple .arrayToStr (this . sort ( array) , field)
224
+ const str = multiple .arrayToStr (array, field)
224
225
if (str === null ) {
225
226
this .error = ' invalid selection'
226
227
return
@@ -229,12 +230,6 @@ export default {
229
230
}
230
231
this .error = ' '
231
232
this .$emit (' update:model-value' , strings .join (' ' ))
232
- },
233
-
234
- sort (array ) {
235
- const a = array .slice ()
236
- a .sort ((a , b ) => a - b)
237
- return a
238
233
}
239
234
}
240
235
}
You can’t perform that action at this time.
0 commit comments