Skip to content

WeAutocomplete ​

v-combobox whose suggestions are loaded from an API resource (through usePaginatedFetch). Unlike we-select, the user can also type a free value. The search text is sent to the server as search (debounced); with paginate more items are loaded when the end of the list is reached.

Usage ​

vue
<template>
  <we-autocomplete
    v-model="user"
    resource="users"
    item-title="full_name"
    item-value="id"
    label="User"
    clearable
  />
</template>

<script setup lang="ts">
const user = ref(null)
</script>

v-model and every other attribute (item-title, item-value, return-object, chips, rules, ...) are passed to v-combobox.

Props ​

PropTypeDefaultDescription
resourcestring--Required. API resource to fetch suggestions from
extraParamsobject{}Extra query params (read once at setup)
multiplebooleanfalseTreats the model as an array when merging selected values into the items
paginateboolean | { limit: number }falseServer pagination (default limit 50) with infinite scroll; disables client-side filtering
clearablebooleanfalseClear icon (never shown while readonly)
readonlybooleannullRead-only
disabledbooleannullDisabled

readonly and disabled default to null: in that case they are inherited from the parent v-form.

Events ​

EventPayloadDescription
errorErrorAPI request failed

update:modelValue and the other events come from v-combobox.

Source Code ​