I have a dropdown using the v-select component and setting my options as "US" and "CANADA".
I want to set the default value (:value
)to read off of customer.country_code
, which is set to "US" in this case but it doesn't have the preloaded selection. I have use v-select in similar instances but not sure what I'm messing up here.
<v-select
:options="['US', 'CA']"
:value="customer.country_code"
v-model="defaultCountry"
</v-select>
The v-model defaultCountry
is initiated like this:
data() {
return {
defaultCountry: null
}
},
props: {
customer: { type: Object }
}
The customer.country_code is a prop so I can't instantiate the v-model to that value.