Generally, lists have selection functions, and single selection, double selection and multiple selection are very common. In custom loop lists and images, implement mouse single selection, multiple selection, and inverse selection functions. # React mousemultiples React mouse multi-select component limitation> Mainly realizes the effect of mouse multi-selection. Without destroying the original list, the embedded component has the mouse multi-selection function.
Install
Using Configuration Items /** * wrapperScroll?: any, // scroll unit 'ID'; * * itemClass: string, // List box general carrying class * * activeClass?: string, // List box selected class * * isDataChange: any, // rendered array, detect data changes * * activePosition?: any, // Actively select data * * onSelected: (pos: any, item: any, data: any) => void, // drag * * onSingleSelected?: (pos: any, item: any, data: any) => void, // click * * Note: itemClass and children loop box className must be consistent, and the same box must be bound to data-position, which exports the selected unique identification. * Note: Items with question marks are optional, otherwise they are required. */ > Operation Instructions: Example: <MouseMultiples wrapperScroll="classify-img_body" itemClass='selection_box' activeClass='selection_box-active' activePosition={activePosition} onSelected={selected} isDataChange={imageLists} {imageLists.map(item => { return ( <div className="selection_box" data-position={item.FileId} > <div className="listImage"><img src={ item.FileUrl } /></div> </div> ) })} </MouseMultiples> > Description: > children custom design, style, grid, selection effect, etc. > Import the component and directly wrap the designed list, make sure the className and itemClass are consistent, make sure to import data-position, and make sure activeClass has a highlighted style. . . The above is the detailed content of React mouse multi-selection function. For more information about React mouse multi-selection, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: MySQL 5.7.18 Archive compressed version installation tutorial
>>: How to delete an image in Docker
Table of contents Preface Case: Imitation of JD.c...
This article mainly introduces the sql serial num...
This article shares the specific code of js to im...
1 Introduction After "Maven deploys Springbo...
Table of contents 1. Overview 1.1 What is a proto...
Quick Start 1. Find the nginx image on Docker Hub...
Table of contents Environmental Description Docke...
Introduction to four commonly used MySQL engines ...
1. ROW_NUMBER() Definition: The ROW_NUMBER() func...
There is often a lack of understanding of multi-c...
There are few and inadequate installation tutoria...
This article shares the specific code of JavaScri...
Table of contents 1. Sample code 2. See the essen...
The following installations all use the ~/ direct...
When any project develops to a certain complexity...