GithubHelp home page GithubHelp logo

doc22940 / vddl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hejianxian/vddl

1.0 1.0 0.0 350 KB

🦄 Vue components for modifying lists with the HTML5 drag & drop API.

Home Page: http://hejx.space/vddl

License: MIT License

JavaScript 39.90% Vue 51.92% HTML 2.33% CSS 5.84%

vddl's Introduction


vddl

Vue components for modifying lists with the HTML5 drag & drop API.

Travis Status npm

💥Warning💥

    1. Don't set index to the :key, it will cause dragging confusion.
<vddl-list :list="list">
    <vddl-draggable class="panel__body--item" 
      v-for="(item, index) in list" 
      :key="item.id" // It's best to use a unique id. Remember, don't use 'index'.
      ...
      >
      {{item.label}}
    </vddl-draggable>
</vddl-list>
    1. "[Vue warn]: Duplicate keys detected: 'A-1'. This may cause an update error. "

Why is this wrong? Because in Vue.js v2.5.0 version, The nextTick's implementation has changed, specific can see here. The reason for throwing this error is that when the element is dropped onto the list, a duplicate object is inserted into the array. Now I think this can be done for you. Add a drop event to the vddl-list and add a moved event to the vddl-draggable. Then you need to splice the array manually. See the demo source code

Links

Features

  • Supports VueJs versions 1.0 and 2.0
  • Supports all modern browsers and Internet Explorer 9+
  • Supports nested lists for building trees and other fancy structures

Touch devices are not supported, because they do not implement the HTML5 drag & drop standard. However, you can use a shim to make it work on touch devices as well.

Installation

npm install --save vddl

# or
yarn add vddl

Usage

import Vue from 'vue';
import Vddl from 'vddl';

Vue.use(Vddl);

Development

# dev
npm install
npm run watch

# build
npm run build

# run example
cd example && npm install
npm run dev

License

MIT

FOSSA Status

vddl's People

Contributors

hejianxian avatar awulkan avatar chuckn0risk avatar michel-ange avatar

Stargazers

Acampbell 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.