element select 多选中增加全选

<template>
  <el-select v-model="value" placeholder="请选择" multiple>
   <el-option :key="all" label="All" value="all" :disabled="value.length > 0 && value.indexOf('all') < 0">el-option>
   <el-option :disabled="value == 'all'" v-for="item in cities" :key="item.value" :label="item.label" :value="item.value"> <span style="float: left">{{ item.label }}span> <span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}span> el-option> el-select> template>

测试地址
https://codepen.io/anon/pen/dBPqbX?&editable=true
将代码贴入html id为app的div中

element select 多选中增加全选_第1张图片element select 多选中增加全选_第2张图片

 

转载于:https://www.cnblogs.com/guozongzhang/p/11011327.html

你可能感兴趣的:(element select 多选中增加全选)