Created
February 17, 2023 07:41
-
-
Save Bouni/99f3745fac59230a846763b18847c45f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<v-combobox v-model="country" :items="countries" item-title="name" item-value="code" label="Land" return-object> | |
<template v-slot:prepend-inner> | |
<span class="mr-2"> | |
<country-flag :country='country.code.toLowerCase()' size='normal' v-if="country"/> | |
</span> | |
</template> | |
<template v-slot:item="{ item }"> | |
<v-list-item> | |
<span class="mr-2"> | |
<country-flag :country='item.value.code.toLowerCase()' size='normal'/> | |
</span> | |
<span>{{ item.title }}</span> ┆ 1 </v-list-item> | |
</template> | |
</v-combobox> | |
</template> | |
<script setup> | |
import { ref } from "vue"; | |
import countries from "@/components/countries.json"; | |
const country = ref(0); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment