Coder Social home page Coder Social logo

dragsort's Introduction

DragSort in PC

基于react 的拖拽并自动排序

使用方法

    <DragSort   
        clickElement = {(element) => {
            console.log("点中的元素是:",element);
        }}
        dragElement = {(element) => {
            console.log("拖拽的持续过程ing,被拖拽元素是:",element);
        }}
        dragOver = {(element) => {
            console.log("拖拽结束(松开鼠标的时候)",element);
        }}

        moveStop = {() => {
            console.log("每一个元素运动停止了以后(只要是点一下就会有 moveStop)");
        } }

        time="1000"//运动时间 默认500ms
        type="ease-out"//运动类型 ease-out减速 默认  ease-in加速 linear匀速 
        className="dragSort"            
    >
        <div>拖动的元素1</div>
        <div>拖动的元素2</div>
        <div>拖动的元素3</div>
        <div>拖动的元素4</div>
        <div>拖动的元素5</div>
        <div>拖动的元素6</div>
        <div>拖动的元素7</div>
        <div>拖动的元素8</div>
        <div>拖动的元素9</div>      
    </DragSort>

API


属性 说明 默认值 类型
clickElement 点中的元素 function
dragElement 拖拽的持续过程 function
dragOver 拖拽结束(松开鼠标的时候) function
moveStop 每一个元素运动停止了以后(只要是点一下就会有 moveStop) function
time 运动时间 单位:毫秒 ms 500 string
type 运动类型 ease-out减速 默认 ease-in加速 linear匀速 ease-out string

预览

  • 概览

截频演示

下载到本地

dragsort's People

Contributors

yellowfrogcn avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.