Update: I have some vue code, main.vue which I would like to call a component, which does three things:
- Allows the user to pass to the component a set of items, one of which can be selected in the component pulldown, using the v-select and v-model API.
- Pass to the component the default pulldown item
- Then communicate back to the parent the selected option from the component's pull-down.
So for example, I can call the component in the main.vue (parent):
<componentPullDown :items="customers", :defaultSelected="preferredCustomer"/>
Then within the componentPullDown vue component, I have the
<div class="box">
<span class="box-header">Speciality</span>
<v-select
label="customer"
:options="items"
:clearable="false"
:item-text="preferredCustomer"
v-model="selectedCustomer"
return-object
/>
<span class="box-label">
</span>
</div>
I have the options for the list working fine, but I can't get the default value to work, or communicate back to the parent the option selected when the pulldown item has changed.
Thanks. Any help would be great.