vue-search-select
vue-search-select copied to clipboard
Not able to use nested attributes
https://codesandbox.io/s/vue-template-rev9c
suppliers: [
{ id: 1, supplier_id: 22, supplier: {
id: 22,
name: "Supplier One"
} }, { id: 2, supplier_id: 32, supplier: {
id: 32,
name: "Supplier Two"
} },
],
<model-list-select
:list="suppliers"
option-value="id"
option-text="supplier.name"
v-model="form.supplier"
placeholder="supplier"
class="form-control col-md-7 col-xs-12"
></model-list-select>
I can't get it to work with a list like this. It won't accept supplier.name for the option text. It just displays blank. If I put in supplier then I can see the data is there and available as the name is now: { "supplier_id": 32, "name": "Supplier Two" }
Help appreciated if it's (likely) just me being dense.
+1