多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
880 B

<script lang="ts" setup>
import { MetaInj } from '~/context'
const { modelValue, field } = defineProps<{
modelValue?: string
field?: any
}>()
const emit = defineEmits(['update:modelValue', 'update:field'])
const localValue = computed({
get: () => modelValue,
set: (val) => emit('update:modelValue', val),
})
const localField = computed({
get: () => field,
set: (val) => emit('update:field', val),
})
const meta = inject(MetaInj)
const columns = computed(() =>
meta?.value?.columns?.map((c) => ({
value: c.id,
label: c.title,
})),
)
</script>
<template>
<a-input-search size="small" v-model:value="localValue" class="max-w-[250px]">
<template #addonBefore>
<a-select v-model:value="localField" :options="columns" style="width: 100px" class="!text-xs " size="small" />
</template>
</a-input-search>
</template>
<style scoped></style>