fix: Link control was showing only 20 records

This commit is contained in:
Shariq Ansari 2023-11-13 17:03:15 +05:30
parent eadea3e680
commit 8224af82be
2 changed files with 8 additions and 2 deletions

View File

@ -4,6 +4,7 @@
{{ attrs.label }} {{ attrs.label }}
</label> </label>
<Autocomplete <Autocomplete
ref="autocomplete"
:options="options" :options="options"
v-model="value" v-model="value"
:size="attrs.size || 'sm'" :size="attrs.size || 'sm'"
@ -16,7 +17,7 @@
<script setup> <script setup>
import { call } from 'frappe-ui' import { call } from 'frappe-ui'
import Autocomplete from '@/components/frappe-ui/Autocomplete.vue' import Autocomplete from '@/components/frappe-ui/Autocomplete.vue'
import { useAttrs, computed } from 'vue' import { useAttrs, computed, ref } from 'vue'
import { computedAsync } from '@vueuse/core' import { computedAsync } from '@vueuse/core'
const props = defineProps({ const props = defineProps({
@ -39,9 +40,12 @@ const value = computed({
set: (val) => emit('update:modelValue', val?.value), set: (val) => emit('update:modelValue', val?.value),
}) })
const autocomplete = ref(null)
const text = computed(() => autocomplete.value?.query)
const options = computedAsync(async () => { const options = computedAsync(async () => {
let options = await call('frappe.desk.search.search_link', { let options = await call('frappe.desk.search.search_link', {
txt: '', txt: text.value || '',
doctype: props.doctype, doctype: props.doctype,
}) })
return options?.map((option) => { return options?.map((option) => {

View File

@ -248,4 +248,6 @@ const inputClasses = computed(() => {
'transition-colors w-full', 'transition-colors w-full',
] ]
}) })
defineExpose({ query })
</script> </script>