0

I currently have:

<div id="fields" v-for="(key, field) in ui.account.search_field_url_map" v-bind:key="field.stageName">
   <h2>{{meta.account[field]}}</h2> 
   <input type="text" :v-model="search.field = field" :name="field" placeholder="John">
</div>

This div loads data with v-for this object has a key that I want to be able to use inside of my v-model where data is, inside my data I have:

data(){
    search: {}
}

I want to create objects inside of search based on the data that is being passed through the v-for

Right now if I do

:v-model="search.field = field" I get:

field: "BillingCity"

But I want it to be:

BillingCity: "Whatever input from the form here"

How can I do this?

Kevin Hernandez
  • 1,270
  • 2
  • 19
  • 41

1 Answers1

2

Doing:

v-model="search[field]"

did the trick for me

Kevin Hernandez
  • 1,270
  • 2
  • 19
  • 41