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.
78 lines
1.8 KiB
78 lines
1.8 KiB
<script setup lang="ts"> |
|
import { MetaInj } from '~/components' |
|
|
|
interface Props { |
|
modelValue?: string |
|
} |
|
|
|
const { modelValue } = defineProps<Props>() |
|
|
|
const emit = defineEmits(['update:modelValue']) |
|
|
|
const meta = inject(MetaInj) |
|
|
|
const localValue = computed({ |
|
get: () => modelValue, |
|
set: (val) => emit('update:modelValue', val), |
|
}) |
|
|
|
/* export default { |
|
name: 'FieldListAutoCompleteDropdown', |
|
props: { |
|
columns: Array, |
|
value: String, |
|
}, |
|
computed: { |
|
localValue: { |
|
set(v) { |
|
this.$emit('input', v) |
|
}, |
|
get() { |
|
return this.value |
|
}, |
|
}, |
|
}, |
|
mounted() { |
|
const autocompleteInput = this.$refs.field.$refs.input |
|
autocompleteInput.addEventListener('focus', this.onFocus, true) |
|
}, |
|
methods: { |
|
onFocus(e) { |
|
this.$refs.field.isMenuActive = true // open item list |
|
}, |
|
}, |
|
} */ |
|
</script> |
|
|
|
<template> |
|
<v-autocomplete |
|
ref="field" |
|
v-model="localValue" |
|
class="caption" |
|
:items="meta.columns" |
|
item-value="id" |
|
item-text="title" |
|
:label="$t('objects.field')" |
|
variant="solo" |
|
hide-details |
|
@click.stop |
|
> |
|
<!-- <!– @change="$emit('change')" –> --> |
|
<!-- <template #selection="{ item }"> --> |
|
<!-- <v-icon small class="mr-1"> --> |
|
<!-- {{ item.icon }} --> |
|
<!-- </v-icon> --> |
|
<!-- {{ item.title }} --> |
|
<!-- </template> --> |
|
<!-- <template #item="{ item }"> --> |
|
<!-- <span :class="`caption font-weight-regular nc-fld-${item.title}`"> --> |
|
<!-- <v-icon color="grey" small class="mr-1"> --> |
|
<!-- {{ item.icon }} --> |
|
<!-- </v-icon> --> |
|
<!-- {{ item.title }} --> |
|
<!-- </span> --> |
|
<!-- </template> --> |
|
</v-autocomplete> |
|
</template> |
|
|
|
<style scoped></style>
|
|
|