Reputation:
My dropdown menu seemed to be working fine and now I'm receiving this error, seemingly, out of nowhere. I've tried changing quite a few things in here and can't seem to figure this one out. Is the data type wrong or am I simply calling something funky?
I would appreciate any insight as to what I'm not seeing here!
<div class="col-sm-12 col-md-6 col-lg-4">
<div class="form-group">
<label>Deposit Holder</label>
<v-select
class="highlights"
:options="select.offices"
:on-change="selectOffice"
:searchable="false"
:clear-search-on-select="false"
v-model="select.officeSelected"
></v-select>
</div>
</div>
data() {
return {
now: new Date().toISOString(),
loaded: false,
document: {
office_id: null,
},
select: {
offices: [
{
'value': 1,
'label': 'Nu World Title Kendall',
},
{
'value': 2,
'label': 'Nu World Title KW Kendall Office',
},
{
'value': 3,
'label': 'Nu World Title Miramar',
},
{
'value': 4,
'label': 'Nu World Title Davie',
},
{
'value': 5,
'label': 'Nu World Title Doral',
},
{
'value': 6,
'label': 'Nu World Title Miami Lakes',
},
{
'value': 7,
'label': 'Sanchez Vadillo Coral Gables',
}
],
officeSelected: '',
}
methods: {
selectOffice(option) {
this.select.officeSelected = option;
this.document.office_id = option.value;
},
mounted() {
this.selectOffice();
},
Upvotes: 0
Views: 1275
Reputation: 29092
In mounted
you're calling this.selectOffice()
but not passing it any parameters. The method selectOffice
is then trying to access option.value
but as you haven't passed anything option
will be undefined
.
I would have expected a stack trace to accompany that error message, which would have indicated which functions were involved in causing the problem.
Upvotes: 1