Giter Site home page Giter Site logo

Comments (4)

audetcameron avatar audetcameron commented on August 27, 2024

you should be able to use the serializer

 :data="associative_array"
 :serializer="myvar=> myvar.keywithstringfromassociative_array"

from vue-bootstrap-typeahead.

mattzollinhofer avatar mattzollinhofer commented on August 27, 2024

If we understand you right, this should already be supported.

from vue-bootstrap-typeahead.

ozziest avatar ozziest commented on August 27, 2024

@alexurquhart,

I have an object array and I want to search it with different properties at the same time. I guess, there is not any way to do that now, isn't it? When I use a serializer, it searches only in the serialized array.

from vue-bootstrap-typeahead.

audetcameron avatar audetcameron commented on August 27, 2024

@alexurquhart,

I have an object array and I want to search it with different properties at the same time. I guess, there is not any way to do that now, isn't it? When I use a serializer, it searches only in the serialized array.

you could maybe modify your data strings from your API response (or after the response before you set the value to your v-model"
example :
your response is

{[
{
    'username':'my_username', 
    'first_name':'my_first_name'
},
    'username':'your_username', 
    'first_name':'your_first_name'
}
]} 

use javascript to convert the strings to something like this. (note | is just a character used to separate data in your string) you can use anything you want.

{[
{'my_username | my_first_name'},
{'your_username' | your_first_name}
]} 

then use the custom separator character | to modify the display using a computed property on the "query" v-model data. therefore it only shows my_username but still queries the other data.

from vue-bootstrap-typeahead.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.