2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-22 10:30:34 +03:00

fix(vue3): migrate refs array (#1534)

This commit is contained in:
Martin Desrumaux
2022-01-04 02:07:58 +01:00
committed by GitHub
parent 38cefa74ff
commit 484a7b4bea
+4 -2
View File
@@ -17,7 +17,7 @@
> >
<div ref="selectedOptions" class="vs__selected-options"> <div ref="selectedOptions" class="vs__selected-options">
<slot <slot
v-for="option in selectedValue" v-for="(option, i) in selectedValue"
name="selected-option-container" name="selected-option-container"
:option="normalizeOptionForSlot(option)" :option="normalizeOptionForSlot(option)"
:deselect="deselect" :deselect="deselect"
@@ -34,6 +34,7 @@
<button <button
v-if="multiple" v-if="multiple"
ref="deselectButtons" ref="deselectButtons"
:ref="el => deselectButtons[i] = el"
:disabled="disabled" :disabled="disabled"
type="button" type="button"
class="vs__deselect" class="vs__deselect"
@@ -693,6 +694,7 @@ export default {
pushedTags: [], pushedTags: [],
// eslint-disable-next-line vue/no-reserved-keys // eslint-disable-next-line vue/no-reserved-keys
_value: [], // Internal value managed by Vue Select if no `value` prop is passed _value: [], // Internal value managed by Vue Select if no `value` prop is passed
deselectButtons: []
} }
}, },
@@ -1101,7 +1103,7 @@ export default {
// don't react to click on deselect/clear buttons, // don't react to click on deselect/clear buttons,
// they dropdown state will be set in their click handlers // they dropdown state will be set in their click handlers
const ignoredButtons = [ const ignoredButtons = [
...(this.$refs['deselectButtons'] || []), ...(this.deselectButtons || []),
...([this.$refs['clearButton']] || []), ...([this.$refs['clearButton']] || []),
] ]