Socket
Book a DemoInstallSign in
Socket

vue2-legato-dnd

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue2-legato-dnd

Vue2 component for [Legato Dnd](https://github.com/LazyLZ/legato-dnd).

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

Vue Legato DnD

Vue2 component for Legato Dnd.

See legato-dnd docs for option and event descriptions.

This library is for Vue 2.x, for Vue 3.x please see here: vue-legato-dnd

Basic Usage


<template>
    <DragContainer>
        <Draggable>Item1</Draggable>
        <Draggable>Item1</Draggable>
        <Draggable>Item1</Draggable>
    </DragContainer>
</template>
<script>
import { DragContainer, Draggable } from 'vue-legato-dnd'

export default {
    components: { DragContainer, Draggable }
}
</script>

Bind with Items


<template>
    <DragContainer
        :items="items"
        @orderChange="onOrderChange"
    >
        <Draggable v-for="t in items" :key="t.name">{t.name}</Draggable>
    </DragContainer>
</template>
<script>
export default {
    data: () => ({
        items: [
            { name: 'Alice' },
            { name: 'Bob' },
            { name: 'Candy' },
        ]
    }),
    methods: {
        onOrderChange ({ order }) {
            this.items = order.map(i => this.items[i])
        }
    }
}
</script>

Keywords

drag and drop

FAQs

Package last updated on 26 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.