<template>
<div class="">
<select @change="getEventType($event)">
<option
v-for="option in list"
:key="option.value"
:id="option.value"
:name="option.name"
>
option>
select>
div>
template>
<script>
export default {
name: "",
data() {
return {
list: [{ value: 1, name: "test" }],
index: "",
};
},
components: {},
methods: {
getEventType(id) {
let obj = {};
obj = this.list.find((item) => {
return item.value === id;
});
if (obj !== undefined) {
this.index = JSON.parse(JSON.stringify(obj)).value;
} else {
this.index = "";
}
},
},
};
script>
<style lang=''>
style>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)