charliekassel / vuejs-autocomplete

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

Add support for callback to arbitrarily format the server response #65

Closed nick-giudici closed 5 years ago

nick-giudici commented 5 years ago

We have a use case where an existing server is returning a single object with a key value pair for each autocomplete item. Since we don't have control over the response format of the endpoint, we need something that will allow us reformat the response.

This adds an optional callback that allows for arbitrary reformatting of the data returned from the endpoint.

coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 55


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/components/Autocomplete.vue 1 2 50.0%
<!-- Total: 1 2 50.0% -->
Totals Coverage Status
Change from base Build 52: -0.8%
Covered Lines: 155
Relevant Lines: 160

💛 - Coveralls
charliekassel commented 5 years ago

I've renamed the prop to resultsFormatter and added a test to document usage: d45441a Available from v0.9.0