No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Autocomplete example with simple array

    Help
    2
    3
    1532
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jdash99 last edited by

      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>
      1 Reply Last reply Reply Quote 0
      • rstoenescu
        rstoenescu Admin last edited by

        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?

        1 Reply Last reply Reply Quote 1
        • J
          jdash99 last edited by

          Thank you. I did’t saw the “view source button” before. Autocomplete is what I’m looking for.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post