SOURCE

console 命令行工具 X clear

                    
>
console
new Vue({
    data(){
        return {
            options:[
                {label:"无",value:"none"},
                {label:"香蕉",value:"banana"},
                {label:"苹果",value:"apple"},
                {label:'梨子',value:"pear"}
            ],
            selectValue:[]
        }
    },
    methods:{
        //点击选项
        handleClick(data){
            if(data.value!=='none'){
                //单击的不是无,
                const index=this.selectValue.indexOf('none');
                if(index>-1){
                    this.selectValue.splice(index,1);
                    //如果少了这一行会导致第一次点击没有值
                    this.selectValue.push(data.value);
                }
            }
        },
        //如果是选择的选项里有none,那么选中的值也都是none了!
        handleChange(value){
            if(value.indexOf('none')>-1){
                this.selectValue=['none'];
            }
        }
    }
}).$mount(".demo");
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<div class="demo">
    <el-select v-model="selectValue" multiple placeholder="请选择"
    @change="handleChange"
    >
        <el-option
        v-for="(item,index) in options" 
        :key="index" :label="item.label" :value="item.value"
        @click.native="handleClick(item)"
        >
        <!-- <span>{{ item.label}}</span> -->
        </el-option>
    </el-select>
</div>
.demo{
    width: 100vh;
    height: 100vh;
    margin: auto auto;
}

本项目引用的自定义外部资源