vue3-select2-component, filter by first character
P粉921130067
2023-08-31 10:37:07
<p>I need the filtering option ("Sortizer" in settings works fine) but I can't get the modelValue from the "Input" where I put any symbols. How do I get the first symbol I entered?
Only works for event @select, but it is not suitable for this task</p>
<pre class="brush:php;toolbar:false;"><Select2
value="modelValue"
@input="(e) => modelValue = e.target.value"
:settings="select2Settings"
/>
select2Settings: {
sorter: function (results) {
return results.filter((item) => item.text.startsWith(modelValue))
}
}</pre>
<p>I also tried using event @change but it didn't work at all
In this demo</p>
everything is normal!