首页 > 其他分享 >【React+Antd】 多选下拉框禁止输入

【React+Antd】 多选下拉框禁止输入

时间:2023-05-17 13:35:11浏览次数:31  
标签:禁止 多选 React mode Antd 下拉框

<Select
  options={}
  onChange={provinceChange}
  allowClear
  mode="multiple"//
  showSearch={false}
  maxTagTextLength={4}
/>

mode设置为多选,multiple配合showSearch可以实现禁止选择,mode设置为tags配合showSerach不能实现禁止输入

标签:禁止,多选,React,mode,Antd,下拉框
From: https://www.cnblogs.com/Esai-Z/p/17408465.html

相关文章

  • 【React】react-json-view用法
    react-json-view:前端json可视化插件安装:npminstall--savereact-json-view 使用:importReactJsonfrom'react-json-view'<ReactJson/>配置:<ReactJsoncollapsed={false}//是否收起,true为收起indentWidth={10}//缩进iconStyle='cir......
  • 【React】格式化中国标准时间
    //定义格式化函数:handleTime(time,format){if(time==null||time==undefined||time==""){return"";}vart=newDate(time);vartf=function(i){return(i<10?'0':'')......
  • 【React】视频播放器,ReactPlayer的使用
    importReactfrom'react';importReactPlayerfrom'react-player'//引入constLiveBroadcast=()=>{return<ReactPlayerclassName='react-player'url='....flv'//地址wi......
  • 【Antd】 走马灯Carousel自动轮播加左右切换箭头
    组件内容:<CarouselautoplayafterChange={changeBanner}autoplaySpeed={7000}//添加左右切换箭头arrows={true}prevArrow={<LeftOutlined/>}nextArrow={<RightOutlined/>}><Carousel/>css样式:.ant-carousel.slick-p......
  • 【React】自定义水印方法
    创建水印方法:constsetWaterwark=({//使用ES6的函数默认值方式设置参数的默认取值container=document.body,width='250px',height='160px',textAlign='left',textBaseline='bottom',font='15pxM......
  • 【Antd 】selsect 的 option 选项随页面滚动,或被遮挡解决办法
    <divstyle={{padding:100,height:1000,background:'#eee',position:'relative'}}id="area"><h4>可滚动的区域/scrollablearea</h4><SelectdefaultValue="lucy"style={......
  • 【React+Antd】可编辑表格
    importReact,{useContext,useState,useEffect,useRef}from"react";import{Table,Input,Button,Popconfirm,Form}from"antd";constEditableContext=React.createContext(null);constEditableRow=(props)=>{//编辑表格行let[f......
  • 【React+Antd】 可展开Table
    在antd基础上进行改造,抛弃之前的靠前面+进行展开的方式,在操作列进行点击展开  import{Table}from'antd';importReact,{useState}from'react';import'antd/dist/antd.css';import'./index.css';constAPP=()=>{const[expandedRowKeys,se......
  • 【React】定时器组件
    鼠标移入关闭定时器并清除,鼠标移出组件的时候打开定时器进行循环consttimer=useRef(null);useEffect(()=>{startLoop();},[]);conststartLoop=()=>{stopLoop();timer.current=window.setInterval(()=>{//要干的事},60*......
  • 【Antd】表格超出隐藏,显示三点,触碰提示
    clumns行设置:1onCell:()=>{2return{3style:{4overflow:'hidden',//控制隐藏5whiteSpace:'nowrap',//控制换行6textO......