Autocomplete example with simple array
-
Can someone give me a full example of autocomplete component using a simple array or an object?
I’m trying to replicate the examples in the documentation but haven’t got very far.
This is what I have tried:
<template> <q-autocomplete v-model="terms" @search="search"></q-autocomplete> </template> <script> export default { name: 'test' data () { return { terms: ['sheet', 'purple', 'local', 'face'] } } </script>
-
v-model
is what the user types, not your static list for autocomplete. Please read the documentation again and look at the vue properties > example with static data if this is what you are looking for. If not, also click on “View Source” to check out the source code of the demo.I’m getting the feeling you actually need to use a Select instead. Is Autocomplete what you are actually looking for?
-
Thank you. I did’t saw the “view source button” before. Autocomplete is what I’m looking for.