Fix dropdowns not showing the selected option

This commit is contained in:
Samuel Elliott 2018-04-08 17:00:26 +01:00
parent b62727b046
commit d2f7e6142f
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
1 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@
</span>
</div>
<div class="bd-dropdown-options bd-flex bd-flex-col" ref="options" v-if="active">
<div class="bd-dropdown-option" v-for="option in options" :class="{'bd-dropdown-option-selected': selected === option.value}" @click="select(option)">{{ option.text }}</div>
<div class="bd-dropdown-option" v-for="option in options" :class="{'bd-dropdown-option-selected': value === option.value}" @click="select(option)">{{ option.text }}</div>
</div>
</div>
</template>
@ -32,8 +32,8 @@
},
methods: {
getSelectedText() {
const selected_option = this.options.find(option => option.value === this.selected);
return selected_option ? selected_option.text : this.selected;
const selected_option = this.options.find(option => option.value === this.value);
return selected_option ? selected_option.text : this.value;
},
select(option) {
this.$emit('input', option.value);