56
rated 0 times
[
58]
[
2]
/ answers: 1 / hits: 18107
/ 7 Years ago, sun, february 26, 2017, 12:00:00
I'm in very beginning stage learning Vue.js and encountered problem I can't figure out right now. So I have 1 select field:
data: {
list: {
'Option 1': [ { size:'1',prize:'5' }, { size:'2',prize:'10' } ]
}
}
Then I populating first select field like this:
<select v-model=firstOptions v-on:change=onChange>
<option v-for=(item, index) in list>{{ index }}</option>
</select>
At this point everything is fine, but how to populate another select field based on first select? I need to access size and price.
I'm think this should be done here:
methods: {
onChange: function() {
// get options for second select field
}
}
More From » vuejs2