charliekassel / vuejs-autocomplete

Autocomplete component for Vue js
MIT License
135 stars 78 forks source link

property expected on result #42

Closed rafa-acioly closed 6 years ago

rafa-acioly commented 6 years ago

after trying to populate the autocomplete this error show up;

Error in render: "Error: "name" property expected on result but is not defined."

"name" property expected on result but is not defined.

the code is:

<auto-complete
    source="http://localhost:5000/api/autocomplete/"
    input-class="is-large input"
    results-property="data">
</auto-complete>

i've tried to use a prop "name" but the same error occurs

Another question;

Is possible to remove the icons from input or use my own?

charliekassel commented 6 years ago

What does your response data look like?

rafa-acioly commented 6 years ago

@charliekassel the response is a simple array;

"data": [
    "Thallid",
    "Thorn Thallid",
    "Thalakos Seer",
    "Thalakos Scout",
    "Thalia's Lancers",
    "Thalakos Sentry",
    "Thallid Devourer",
    ...
],
rafa-acioly commented 6 years ago

i've changed the response to use the key name :smile: , now the response is

"data": [
    {"name": "Thallid", id: 1},
    {"name": "Thorn Thallid", id: 2},
    ...
],