How correctly in vuejs using if v-select
check if the element is selected
having in options array with code/label array?
I tried as :
<v-select
v-model="selection_filter_priority"
label="label"
:options="taskPriorityLabels"
id="filter_priority"
name="filter_priority"
class="form-control editable_field"
placeholder="Select all"
></v-select>
console.log('-11 typeof this.selection_filter_priority::')
console.log(typeof this.selection_filter_priority)
console.log(this.selection_filter_priority)
if (typeof this.selection_filter_priority == 'object' && typeof this.selection_filter_priority != null) {
filter_priority = this.selection_filter_priority.code // But if option is not selected(null) I got error here:
}
Which is the valid way?
"vue": "^2.6.10", "vue-select": "^3.2.0",