<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>
Logo

前往低代码交流专区

更多推荐