tmagic-editor/packages/form/src/fields/SelectOptions.vue
2023-05-29 17:37:34 +08:00

25 lines
477 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>
import { TMagicOption } from '@tmagic/design';
import { SelectOption } from '../schema';
defineOptions({
name: 'MFormSelectOptions',
});
defineProps<{
options: SelectOption[];
valueKey?: string;
}>();
</script>