Git Product home page Git Product logo

vue3-sortable's Introduction

vue3-sortable

Minimal, kind-of opinionated, Vue 3 sortable list component.

Developed for Pigments app.

Check out the demo folder.

Slots

#item - Receives the v-for directive item as a prop.

Props

modelValue

Type: Array
Required: true

The list of items that need to be sorted.

direction

Type: String
Required: false
Default: vertical
Values: [vertical, horizontal]

The direction of the sortable.

handle

Type: String
Required: false
Default: null

CSS class selector used as a drag handle. If the handle is not provided, the item can be moved from anywhere.

itemClass

Type: String
Required: false
Default: null

CSS class applied to the items.

animationDuration

Type: Number
Required: false
Default: 200

Reorder animation duration, in ms.

animationEasing

Type: String
Required: false
Default: ease

Reorder animation easing, any CSS transition accepted.

autosScrollEnabled

Type: Boolean
Required: false
Default: true

Whether to auto-scroll when near the edges of the list, when overflow is present.

disabled

Type: Boolean
Required: false
Default: true

Disable the sortable.

Emits

update:modelValue

drag-start

Parameters:

  • index - The initial index of the dragged element.

drag-end

  • oldIndex - The initial index of the dragged element.
  • newIndex - The final index of the dragged element.
  • value - The reordered list.

index-change

Triggers when the dragged item index changes.

  • oldIndex - The initial index of the dragged element.
  • newIndex - The final index of the dragged element.

vue3-sortable's People

Contributors

covorsorin avatar

Stargazers

 avatar

Watchers

 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.