File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -146,13 +146,16 @@ const availableOptions = computed(() => {
146
146
});
147
147
148
148
const selectedOptions = computed (() => {
149
- if (props .isMulti ) {
150
- // We can safely assume it's an array due to the `isMulti` prop validation done earlier.
149
+ if (props .isMulti && Array .isArray (selected .value )) {
151
150
return (selected .value as OptionValue []).map (
152
151
(value ) => props .options .find ((option ) => option .value === value )! ,
153
152
);
154
153
}
155
154
155
+ if (props .isMulti && ! Array .isArray (selected .value )) {
156
+ console .warn (` [vue3-select-component warn]: The v-model provided should be an array when using \` isMulti\` prop, instead it was: ${selected .value } ` );
157
+ }
158
+
156
159
const found = props .options .find ((option ) => option .value === selected .value );
157
160
158
161
return found ? [found ] : [];
You can’t perform that action at this time.
0 commit comments