1.0.4 • Published 6 months ago

@ziad_rashad/vue-sortable v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Vue Sortable Component

A lightweight Vue 3 sortable component that supports both RTL (right-to-left) and LTR (left-to-right) layouts.

Features

  • Supports both RTL and LTR directions.
  • Lightweight and dependency-free.
  • Easy to integrate with Vue 3.
  • Supports both horizontal and vertical sorting.
  • Fully customizable via slots and styles.

Installation

npm install @ziad_rashad/vue-sortable

Usage

<script setup>
import { ref } from 'vue';
import VueSortable from '@ziad_rashad/vue-sortable';

const items = ref(['Item 1', 'Item 2', 'Item 3', 'Item 4']);
</script>

<template>
  <VueSortable v-model="items" direction="horizontal">
    <template v-slot="{ item }">
      <div class="sortable-box">{{ item }}</div>
    </template>
  </VueSortable>
</template>

<style>
.sortable-box {
  padding: 10px;
  background: lightgray;
  margin: 5px;
  border-radius: 5px;
  text-align: center;
}
</style>

Props

PropTypeDefaultDescription
modelValueArray[]List of sortable items.
directionStringhorizontalSorting direction (horizontal or vertical).

License

MIT

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago