mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-25 01:06:15 -04:00
feat(i18n): language selector (#710)
This commit is contained in:
parent
58de8970f5
commit
e86fd96ae3
12 changed files with 182 additions and 46 deletions
|
@ -33,4 +33,19 @@ const value = ref('');
|
|||
<c-select label="Label" label-position="left" label-align="left" mb-2 label-width="200px" />
|
||||
<c-select label="Label" label-position="left" label-align="center" mb-2 label-width="200px" />
|
||||
<c-select label="Label" label-position="left" label-align="right" mb-2 label-width="200px" />
|
||||
|
||||
<h2>Custom displayed value</h2>
|
||||
<c-select v-model:value="value" :options="optionsA" mb-2>
|
||||
<template #displayed-value>
|
||||
<span class="font-bold lh-normal">Hello</span>
|
||||
</template>
|
||||
</c-select>
|
||||
|
||||
<c-select v-model:value="value" :options="optionsA">
|
||||
<template #displayed-value>
|
||||
<span lh-normal>
|
||||
<icon-mdi-translate />
|
||||
</span>
|
||||
</template>
|
||||
</c-select>
|
||||
</template>
|
||||
|
|
|
@ -150,13 +150,15 @@ function onSearchInput() {
|
|||
@keydown="handleKeydown"
|
||||
>
|
||||
<div flex-1 truncate>
|
||||
<input v-if="searchable && isOpen" ref="searchInputRef" v-model="searchQuery" type="text" placeholder="Search..." class="search-input" w-full lh-normal color-current @input="onSearchInput">
|
||||
<span v-else-if="selectedOption" lh-normal>
|
||||
{{ selectedOption.label }}
|
||||
</span>
|
||||
<span v-else class="placeholder" lh-normal>
|
||||
{{ placeholder ?? 'Select an option' }}
|
||||
</span>
|
||||
<slot name="displayed-value">
|
||||
<input v-if="searchable && isOpen" ref="searchInputRef" v-model="searchQuery" type="text" placeholder="Search..." class="search-input" w-full lh-normal color-current @input="onSearchInput">
|
||||
<span v-else-if="selectedOption" lh-normal>
|
||||
{{ selectedOption.label }}
|
||||
</span>
|
||||
<span v-else class="placeholder" lh-normal>
|
||||
{{ placeholder ?? 'Select an option' }}
|
||||
</span>
|
||||
</slot>
|
||||
</div>
|
||||
|
||||
<icon-mdi-chevron-down class="chevron" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue