2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-10 07:52:23 +03:00

wip listbox concept

This commit is contained in:
Jeff Sagal
2022-11-16 13:58:06 -08:00
parent 4942cb20ac
commit 6c9a480a04
8 changed files with 203 additions and 36 deletions
+25 -3
View File
@@ -1,17 +1,39 @@
<template>
<div id="app">
<v-select v-model="selected" v-bind="config" />
<ListBox
v-model="selected"
:open="open"
class="px-2 text-left border border-gray-500 rounded w-64 relative bg-blue-100 h-12"
>
{{ selected?.label }}
<ListBoxMenu
class="absolute inset-0 top-12 w-full h-64 overflow-y-scroll bg-red-100 space-y-1"
>
<ListBoxOption
@click="selected = country"
v-for="country in config.options"
:key="country.id"
class="px-2 py-1"
>
{{ country.label }}
</ListBoxOption>
</ListBoxMenu>
</ListBox>
</div>
</template>
<script>
import vSelect from '@/components/Select.vue'
import countries from '../docs/.vuepress/data/countryCodes.js'
import ListBox from '@/components/ListBox/ListBox.vue'
import ListBoxMenu from '@/components/ListBox/ListBoxMenu.vue'
import ListBoxOption from '@/components/ListBox/ListBoxOption.vue'
export default {
components: { vSelect },
components: { ListBoxOption, ListBoxMenu, ListBox },
data: () => ({
selected: null,
config: {
options: countries,
},