mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-23 16:30:45 +01:00
fix(Select): move types from template
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
:label="option[textAttribute]"
|
:label="option[textAttribute]"
|
||||||
>
|
>
|
||||||
<option
|
<option
|
||||||
v-for="(childOption, index2) in (option.children as any[])"
|
v-for="(childOption, index2) in option.children"
|
||||||
:key="`${childOption[valueAttribute]}-${index}-${index2}`"
|
:key="`${childOption[valueAttribute]}-${index}-${index2}`"
|
||||||
:value="childOption[valueAttribute]"
|
:value="childOption[valueAttribute]"
|
||||||
:selected="childOption[valueAttribute] === normalizedValue"
|
:selected="childOption[valueAttribute] === normalizedValue"
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, defineComponent } from 'vue'
|
import { computed, defineComponent } from 'vue'
|
||||||
import type { PropType } from 'vue'
|
import type { PropType, ComputedRef } from 'vue'
|
||||||
import { get } from 'lodash-es'
|
import { get } from 'lodash-es'
|
||||||
import { defu } from 'defu'
|
import { defu } from 'defu'
|
||||||
import Icon from '../elements/Icon.vue'
|
import Icon from '../elements/Icon.vue'
|
||||||
@@ -158,7 +158,7 @@ export default defineComponent({
|
|||||||
return props.options.map(option => normalizeOption(option))
|
return props.options.map(option => normalizeOption(option))
|
||||||
})
|
})
|
||||||
|
|
||||||
const normalizedOptionsWithPlaceholder = computed(() => {
|
const normalizedOptionsWithPlaceholder: ComputedRef<{ disabled?: boolean, children: { disabled?: boolean }[] }[]> = computed(() => {
|
||||||
if (!props.placeholder) {
|
if (!props.placeholder) {
|
||||||
return normalizedOptions.value
|
return normalizedOptions.value
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user