Git Product home page Git Product logo

Comments (9)

phphe avatar phphe commented on May 13, 2024

no, it doesn't support this case.

from vue-draggable-nested-tree.

FlameArtLab avatar FlameArtLab commented on May 13, 2024

I got it.

Firstly, you need fix the #38

Then add information about target in drop event (DraggableTreeNode.vue), appendTo and targetTree:

      drop: (e, opt, store) => {
        const draggableHelperInfo = {
          event: e, options: opt, store,
          appendTo: dplh._vm.$parent.data,
          targetTree: dplh._vm.store
        }

And just hook ondragend in your code, return false and push pure copy of element into target:

  ondragend(node, draggableHelperInfo) {

    if(!draggableHelperInfo.appendTo.hasOwnProperty('children')) 
      draggableHelperInfo.appendTo['children']=[];
    
    draggableHelperInfo.appendTo.children.push(draggableHelperInfo.targetTree.pure(node, true));

    return false;
  }

i realize that in FlameArtLab@a11ff52

This solution visually worse, than clone in Nested Sortable for jquery, and it only append, but it worked good and you can use insertAfter\Before in ur code for precise positioning

from vue-draggable-nested-tree.

phphe avatar phphe commented on May 13, 2024

I think ondragstart is better for clone. The feature will make it more complex. I may add it in the future.

from vue-draggable-nested-tree.

BackMoonTheWall avatar BackMoonTheWall commented on May 13, 2024

so now in version 2.2.17 ,how can i clone node and drag?

from vue-draggable-nested-tree.

phphe avatar phphe commented on May 13, 2024

still not support

from vue-draggable-nested-tree.

phphe avatar phphe commented on May 13, 2024

so now in version 2.2.17 ,how can i clone node and drag?

still not support

from vue-draggable-nested-tree.

Kamyhin avatar Kamyhin commented on May 13, 2024

Hi!
still not support?

from vue-draggable-nested-tree.

phphe avatar phphe commented on May 13, 2024

This is supported in new repo: he-tree-vue https://he-tree-vue.phphe.com/api.html#clonewhendrag
vue-draggable-nested-tree don't support this, and it is no longer be maintained

from vue-draggable-nested-tree.

Kamyhin avatar Kamyhin commented on May 13, 2024

Well thank you!

from vue-draggable-nested-tree.

Related Issues (20)

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.