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

    data/autocomplete.json file?

    Help
    1
    1
    568
    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
      joefly last edited by joefly

      I’m trying to replicate the Autocomplete (countries) example from the docs, however, I cannot find the file referenced in the script:

      import countries from 'data/autocomplete.json'
      

      Is this coming from a node module? Any idea which one?

      Thanks 🙂

      EDIT:

      I got this to work with the following NPM package: country-json

      I had to make some minor changes to the code:

      import countries from 'country-json/src/countries-by-name.json'
      
      and...
      
        function parseCountries () {
          return countries.map(item => {
            let countryName = item.country
            return {
              label: countryName,
              sublabel: getRandomSecondLabel(),
              icon: getRandomIcon(),
              stamp: getRandomStamp(),
              value: countryName
            }
          })
        }
      
      1 Reply Last reply Reply Quote 1
      • First post
        Last post