el-select selects up to two

multipleel-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 limitachieve.

Specifically, you need to multipleset the attribute to true, and limitset 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 

Guess you like

Origin blog.csdn.net/weixin_35756690/article/details/129525757#comments_26803634