multiple
el-select is a drop-down selection component based on Element UI. If you need to limit el-select to only two options at most, you can use the and attributes provided by this component to limit
achieve.
Specifically, you need to multiple
set the attribute to true
, and limit
set the attribute to 2, so that el-select can allow multiple options to be selected, and only two options can be selected at most.
Here is a simple sample code:
<template>
<el-select v-model="selectedOptions" multiple :limit="2">
<el-option