在 vuejs 中使用 ifv-select检查元素是否在带有代码/标签数组的选项数组中被选中的正确性如何?
我试过:
<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:
}
哪个是有效的方式?
“vue”:“^2.6.10”,“vue-select”:“^3.2.0”,