Element-ui drop-down selection how to find which one I chose

Jun.23,2022

this should be what you want

change(val){
      const length = val.length
      console.log(val[length - 1])
}

this is an array. You should find the index value manually


.

you can listen for change events:

<template>
  <el-select 

 @change="valueChange" 

 v-model="value5" multiple placeholder="">
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value="item.value">
    </el-option>
  </el-select>

  <el-select
    v-model="value11"
    multiple
    collapse-tags
    style="margin-left: 20px;"
    placeholder="">
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value="item.value">
    </el-option>
  </el-select>
</template>

<script>
  export default {
    data() {
      return {
        options: [{
          value: '1',
          label: ''
        }, {
          value: '2',
          label: ''
        }, {
          value: '3',
          label: ''
        }, {
          value: '4',
          label: ''
        }, {
          value: '5',
          label: ''
        }],
        value5: [],
        value11: []
      }
    },
     methods:{
        valueChange:function(){
            console.log(this.value5)
        }
    }
  }
</script>

result:
clipboard.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e484b8-44cbf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e484b8-44cbf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?