drag-scroll-vue3
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

drag-scroll-vue3

This package provide directive for drag scroll

Installation

npm install drag-scroll-vue3

Basic usage

import { createApp } from "vue";
import App from "./App.vue";
import dragScroll from "drag-scroll-vue3";

const app = createApp(App);

app.directive("drag-scroll", dragScroll);
app.mount("#app");
<your-component-with-list v-drag-scroll>
  <block />
  <block />
  <block />
  <block />
  <block />
</your-component-with-list>

In this case, scroll will work for all directions at a speed equal to 1

Modify speed and direction

<your-component-with-list v-drag-scroll.options="{ speed: 2, direction: 'y' }">
  <block />
  <block />
  <block />
  <block />
  <block />
</your-component-with-list>

Available direction option

  • all
  • x
  • y

Dependencies (0)

    Dev Dependencies (16)

    Package Sidebar

    Install

    npm i drag-scroll-vue3

    Weekly Downloads

    258

    Version

    1.1.2

    License

    MIT

    Unpacked Size

    3.76 kB

    Total Files

    6

    Last publish

    Collaborators

    • vashuber