Socket
Book a DemoInstallSign in
Socket

vue-dragable

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-dragable

a dragable component for vue

0.0.5
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

vue-dragable

A sortable list component for Vue!

Install

npm i -S vue-dragable

Example

// app's main.js
import Vue from "vue";
import vueDragable from "vue-dragable";

Vue.use(vueDragable);
<script>
    export default {
        data() {
            return {
                data: [{ id: '00', value: "0" }, { id: '11', value: "1" }, { id: '22', value: "2" }, { id: '33', value: "3" }, { id: '44', value: "4" }]
            }
        },
        methods: {
            onSort(data) {
              console.log(data);
            }
        }
    }
</script>
<template>
	<el-form label-width="80px">
        <dragable v-model="data" @sort="onSort">
            <template slot-scope="{ data }">
                <el-form-item v-for="(item, n) in data" :key="item.id" label="输入框:">
                    <el-input v-model="data[n].value"></el-input>
                </el-form-item>
            </template>
        </dragable>
	</el-form>
</template>

API

props

value/v-model : {array} - a list data

events

sort : Triggered when the list is sorted

  • callback fun's params: data : {array} - new list data

FAQs

Package last updated on 26 May 2019

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.