mirror of https://github.com/nocodb/nocodb
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
853 B
38 lines
853 B
2 years ago
|
<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 v-model:value="localValue" class="max-w-[250px]">
|
||
|
<template #addonBefore>
|
||
|
<a-select v-model:value="localField" :options="columns" style="width: 100px" class="!text-xs" />
|
||
|
</template>
|
||
|
</a-input-search>
|
||
|
</template>
|
||
|
|
||
|
<style scoped></style>
|