vue下拉框多选

v-model绑定的value2就是你下拉框要多选的参数,例:[‘HTML’,‘CSS’]

  <el-select
    v-model="value2"
    allow-create
             filterable multiple collapse-tags
    default-first-option
    placeholder="请选择文章标签">
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value="item.value">
    el-option>
  el-select>
      return {
        options: [{
          value: 'HTML',
          label: 'HTML'
        }, {
          value: 'CSS',
          label: 'CSS'
        }, {
          value: 'JavaScript',
          label: 'JavaScript'
        }],
        value2: ['HTML','CSS']
      }
    }

你可能感兴趣的:(web,vue)