mirror of https://github.com/nocodb/nocodb
Pranav C
2 years ago
2 changed files with 39 additions and 1 deletions
@ -0,0 +1,37 @@
|
||||
<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> |
Loading…
Reference in new issue