如何传递对象vue js的ID
我有一个json文件,需要从选择器中获取所选选项的ID
<div class="select">
<div class="select-header form-control" v-on:click="AddForm(1)">
<span class="select__current" v-if="status_id == null">Please select status</span>
<span v-else>{{ typeStatus[status_id].name }}</span>
</div>
<div class=" select__body" v-if="addedForm === 1">
<div class="select-item" v-for="(type, index) in typeStatus" v-bind:key="type.id" v-on:click="status_id = index; addedForm = false;">
{{ type.name }}
</div>
</div>
</div>
methods: {
search() {
this.filter.append('status', this.typeStatus[this.status_id].id)
this.$emit('filter', this.filter);
},
}