tmagic-editor/packages/form/src/fields/SelectOptions.vue
2022-11-03 14:14:54 +08:00

21 lines
452 B
Vue

<template>
<TMagicOption
v-for="option in options"
:label="option.text"
:value="option.value"
:key="valueKey ? option.value[valueKey] : option.value"
:disabled="option.disabled"
></TMagicOption>
</template>
<script lang="ts" setup name="MFormSelectOptions">
import { TMagicOption } from '@tmagic/design';
import { SelectOption } from '../schema';
defineProps<{
options: SelectOption[];
valueKey?: string;
}>();
</script>