mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-19 09:50:33 +03:00
docs: customizing dropdown behaviour (#1520)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<v-select
|
||||
v-model="country"
|
||||
:options="countries"
|
||||
:dropdown-should-open="dropdownShouldOpen"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import countries from '../data/countries.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
countries,
|
||||
country: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dropdownShouldOpen(VueSelect) {
|
||||
if (this.country !== null) {
|
||||
return VueSelect.open
|
||||
}
|
||||
|
||||
return VueSelect.search.length !== 0 && VueSelect.open
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -59,6 +59,7 @@ module.exports = {
|
||||
children: [
|
||||
['guide/keydown', 'Keydown Events'],
|
||||
['guide/positioning', 'Dropdown Position'],
|
||||
['guide/opening', 'Dropdown Opening'],
|
||||
['guide/filtering', 'Option Filtering'],
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user