当前位置:   article > 正文

el-select多选全选_el-select 多选

el-select 多选
  1. <template>
  2. <div>
  3. <el-select @change="handleSelect($event)" v-model="selectVal" placeholder="请选择" multiple collapse-tags>
  4. <el-option
  5. v-for="item in array"
  6. :key="item.value"
  7. :label="item.label"
  8. :value="item.value">
  9. </el-option>
  10. </el-select>
  11. <div>{
  12. {this.selectVal}}</div>
  13. </div>
  14. </template>
  15. <script>
  16. export default {
  17. name: 'selectMultiple',
  18. data () {
  19. return {
  20. array: [],
  21. selectVal: [],
  22. oldSelectVal: []
  23. }
  24. },
  25. mounted () {
  26. this.initSelect()
  27. },
  28. methods: {
  29. initSelect () {
  30. this.array = [{label: '全部', value: 'ALL'}]
  31. for (let i = 0; i < 10; i++) {
  32. this.array.push({
  33. label: '选择项' + i,
  34. value: i
  35. })
  36. }
  37. },
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/107266?site
推荐阅读