├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .postcssrc.js ├── LICENSE ├── README.md ├── README_ZH.md ├── build ├── build.js ├── check-versions.js ├── utils.js ├── vue-loader.conf.js ├── webpack.base.conf.js └── webpack.prod.conf.js ├── dist ├── vue-drag-tree.min.css ├── vue-drag-tree.min.css.map ├── vue-drag-tree.min.js └── vue-drag-tree.min.js.map ├── package-lock.json ├── package.json ├── src ├── DragNode.vue ├── VueDragTree.vue ├── index.js └── util.js ├── static └── preview.gif └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": ["transform-runtime"], 12 | "env": { 13 | "test": { 14 | "presets": ["env", "stage-2"], 15 | "plugins": ["istanbul"] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | build/*.js 2 | config/*.js 3 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | // http://eslint.org/docs/user-guide/configuring 2 | 3 | module.exports = { 4 | root: true, 5 | parser: 'babel-eslint', 6 | parserOptions: { 7 | sourceType: 'module' 8 | }, 9 | env: { 10 | browser: true, 11 | }, 12 | // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style 13 | extends: 'standard', 14 | // required to lint *.vue files 15 | plugins: [ 16 | 'html' 17 | ], 18 | // add your custom rules here 19 | 'rules': { 20 | // allow paren-less arrow functions 21 | 'arrow-parens': 0, 22 | // allow async-await 23 | 'generator-star-spacing': 0, 24 | // allow debugger during development 25 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | test/e2e/reports 7 | selenium-debug.log 8 | 9 | # Editor directories and files 10 | .idea 11 | *.suo 12 | *.ntvs* 13 | *.njsproj 14 | *.sln 15 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | // to edit target browsers: use "browserlist" field in package.json 6 | "autoprefixer": {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 版权所有(c)2019 https://github.com/shuiRong 2 | 3 | 反996许可证版本1.0 4 | 5 | 在符合下列条件的情况下,特此免费向任何得到本授权作品的副本(包括源代码、文件和/或相关内容,以下 6 | 统称为“授权作品”)的个人和法人实体授权:被授权个人或法人实体有权以任何目的处置授权作品,包括但 7 | 不限于使用、复制,修改,衍生利用、散布,发布和再许可: 8 | 9 | 1. 个人或法人实体必须在许可作品的每个再散布或衍生副本上包含以上版权声明和本许可证,不得自行修 10 | 改。 11 | 2. 个人或法人实体必须严格遵守与个人实际所在地或个人出生地或归化地、或法人实体注册地或经营地 12 | (以较严格者为准)的司法管辖区所有适用的与劳动和就业相关法律、法规、规则和标准。如果该司法管辖 13 | 区没有此类法律、法规、规章和标准或其法律、法规、规章和标准不可执行,则个人或法人实体必须遵守国 14 | 际劳工标准的核心公约。 15 | 3. 个人或法人不得以任何方式诱导或强迫其全职或兼职员工或其独立承包人以口头或书面形式同意直接或 16 | 间接限制、削弱或放弃其所拥有的,受相关与劳动和就业有关的法律、法规、规则和标准保护的权利或补救 17 | 措施,无论该等书面或口头协议是否被该司法管辖区的法律所承认,该等个人或法人实体也不得以任何方法 18 | 限制其雇员或独立承包人向版权持有人或监督许可证合规情况的有关当局报告或投诉上述违反许可证的行为 19 | 的权利。 20 | 21 | 该授权作品是"按原样"提供,不做任何明示或暗示的保证,包括但不限于对适销性、特定用途适用性和非侵 22 | 权性的保证。在任何情况下,无论是在合同诉讼、侵权诉讼或其他诉讼中,版权持有人均不承担因本软件或 23 | 本软件的使用或其他交易而产生、引起或与之相关的任何索赔、损害或其他责任。 24 | 25 | Anti 996 License Version 1.0 26 | 27 | Permission is hereby granted to any individual or legal entity 28 | obtaining a copy of this licensed work (including the source code, 29 | documentation and/or related items, hereinafter collectively referred 30 | to as the "licensed work"), free of charge, to deal with the licensed 31 | work for any purpose, including without limitation, the rights to use, 32 | reproduce, modify, prepare derivative works of, distribute, publish 33 | and sublicense the licensed work, subject to the following conditions: 34 | 35 | 1. The individual or the legal entity must conspicuously display, 36 | without modification, this License and the notice on each redistributed 37 | or derivative copy of the Licensed Work. 38 | 39 | 2. The individual or the legal entity must strictly comply with all 40 | applicable laws, regulations, rules and standards of the jurisdiction 41 | relating to labor and employment where the individual is physically 42 | located or where the individual was born or naturalized; or where the 43 | legal entity is registered or is operating (whichever is stricter). In 44 | case that the jurisdiction has no such laws, regulations, rules and 45 | standards or its laws, regulations, rules and standards are 46 | unenforceable, the individual or the legal entity are required to 47 | comply with Core International Labor Standards. 48 | 49 | 3. The individual or the legal entity shall not induce or force its 50 | employee(s), whether full-time or part-time, or its independent 51 | contractor(s), in any methods, to agree in oral or written form, to 52 | directly or indirectly restrict, weaken or relinquish his or her 53 | rights or remedies under such laws, regulations, rules and standards 54 | relating to labor and employment as mentioned above, no matter whether 55 | such written or oral agreement are enforceable under the laws of the 56 | said jurisdiction, nor shall such individual or the legal entity 57 | limit, in any methods, the rights of its employee(s) or independent 58 | contractor(s) from reporting or complaining to the copyright holder or 59 | relevant authorities monitoring the compliance of the license about 60 | its violation(s) of the said license. 61 | 62 | THE LICENSED WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 63 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 64 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 65 | IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, 66 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 67 | OTHERWISE, ARISING FROM, OUT OF OR IN ANY WAY CONNECTION WITH THE 68 | LICENSED WORK OR THE USE OR OTHER DEALINGS IN THE LICENSED WORK. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-drag-tree 2 | 3 | [](https://www.npmjs.com/package/vue-drag-tree)[](https://www.npmjs.com/package/vue-drag-tree)[](https://opensource.org/licenses/MIT) 4 | 5 | > It's a tree components(Vue2.x) that allow you to drag and drop the node to exchange their data . 6 | 7 | **Feature** 8 | 9 | - **Double click** on an node to turn it into a folder 10 | - **Drag and Drop** the tree node, even between two different levels 11 | - **Customize your node (how to display node. eg: node name and left icon )** 12 | - **Controls** whether a particular node can **be dragged** and whether the node can be plugged into other nodes 13 | - **Append/Remove** Node in any level (#TODO) 14 | 15 | **[中文](README_ZH.md)** || **Please Star! if it's helpful**. 16 | **[Example Project](https://github.com/shuiRong/vue-drag-tree-demo)** 17 | 18 | ### Preview 19 | 20 | --- 21 | 22 |  23 | 24 | ### Getting Start 25 | 26 | --- 27 | 28 | **Install** 29 | 30 | `npm install vue-drag-tree --S` 31 | 32 | or 33 | 34 | `yarn add vue-drag-tree -S` 35 | 36 | **Usage** 37 | 38 | the following code is come from [here](https://github.com/shuiRong/vue-drag-tree-demo) 39 | 40 | 41 | 42 | **P.S.** If you get error about` Vue packages version mismatch` 43 | 44 | 45 | ```bash 46 | // Update the version of Vue and vue-template-compiler to latest is fine. 47 | npm install vue@latest -S 48 | npm install vue-template-compiler@latest -D 49 | ``` 50 | 51 | main.js 52 | 53 | ```vue 54 | import Vue from 'vue' 55 | import VueDragTree from 'vue-drag-tree' 56 | import 'vue-drag-tree/dist/vue-drag-tree.min.css' 57 | 58 | Vue.use(VueDragTree) 59 | ``` 60 | 61 | test.vue 62 | 63 | ```vue 64 | 65 | 66 | 67 | 68 | {{slotProps.nodeName}} 69 | 70 | 71 | \n\n\n\n\n\n// WEBPACK FOOTER //\n// ./src/DragNode.vue?786e227c"],"sourceRoot":""} -------------------------------------------------------------------------------- /dist/vue-drag-tree.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("VueDragTree",[],t):"object"==typeof exports?exports.VueDragTree=t():e.VueDragTree=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=15)}([function(e,t,n){e.exports=!n(2)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports={default:n(17),__esModule:!0}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(21);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(8),o=n(6);e.exports=function(e){return r(o(e))}},function(e,t){e.exports=function(e,t,n,r,o){var i,u=e=e||{},a=typeof e.default;"object"!==a&&"function"!==a||(i=e,u=e.default);var c="function"==typeof u?u.options:u;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns),r&&(c._scopeId=r);var s;if(o?(s=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},c._ssrRegister=s):n&&(s=n),s){var d=c.functional,l=d?c.render:c.beforeCreate;d?c.render=function(e,t){return s.call(t),l(e,t)}:c.beforeCreate=l?[].concat(l,s):[s]}return{esModule:i,exports:u,options:c}}},function(e,t,n){var r=n(11)(n(14),n(46),null,null,null);r.options.__file="/Users/shuirong/Code/vue-drag-tree/src/VueDragTree.vue",r.esModule&&Object.keys(r.esModule).some(function(e){return"default"!==e&&"__"!==e.substr(0,2)})&&console.error("named exports are not supported in *.vue files."),r.options.functional&&console.error("[vue-loader] VueDragTree.vue: functional components are not supported with templates, they should use render functions."),e.exports=r.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16),o=1e3,i=null,u=null,a=void 0,c=null;t.default={name:"DragNode",data:function(){return{open:!1,isClicked:!1,isHover:!1,styleObj:{opacity:1}}},props:{model:Object,allowDrag:{type:Function,default:function(){return!0}},allowDrop:{type:Function,default:function(){return!0}},defaultText:{type:String,default:"New Node"},depth:{type:Number,default:0},disableDBClick:{type:Boolean,default:!1}},computed:{isFolder:function(){return this.model.children&&this.model.children.length},increaseDepth:function(){return this.depth+1},isDraggable:function(){return this.allowDrag(this.model,this)}},methods:{toggle:function(){if(this.isFolder&&(this.open=!this.open),c.emitCurNodeClicked(this.model,this),this.isClicked=!this.isClicked,a!=this.model.id){for(var e=c.$parent,t=[e.$children[0]];0!=t.length;){var n=t.shift();n.isClicked=!1,n.$children&&n.$children.length>0&&(t=t.concat(n.$children))}this.isClicked=!0,a=this.model.id}},changeType:function(){this.disableDBClick||(this.currentHighlight&&(a=this.model.id),this.isFolder||(this.$set(this.model,"children",[]),this.addChild(),this.open=!0,this.isClicked=!0))},mouseOver:function(e){this.isHover=!0},mouseOut:function(e){this.isHover=!1},addChild:function(){this.model.children.push({name:this.defaultText,id:o++})},removeChild:function(e){var t=this.$parent.model.children;for(var n in t)if(t[n].id==e){t=t.splice(n,1);break}},drag:function(e){i=this,c.emitDrag(this.model,this,e)},dragStart:function(e){return e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain","asdad"),!0},dragOver:function(e){return e.preventDefault(),c.emitDragOver(this.model,this,e),!0},dragEnter:function(e){this._uid!==i._uid&&(this.styleObj.opacity=.5),c.emitDragEnter(this.model,this,e)},dragLeave:function(e){this.styleObj.opacity=1,c.emitDragLeave(this.model,this,e)},drop:function(e){e.preventDefault(),this.styleObj.opacity=1,this.allowDrop(this.model,this)&&(u=this,n.i(r.a)(c,i,u),c.emitDrop(this.model,this,e))},dragEnd:function(e){c.emitDragEnd(this.model,this,e)}},created:function(){c=n.i(r.b)(this)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n.n(r),i=n(45),u=n.n(i);t.default={name:"VueDragTree",props:{data:Array,allowDrag:{type:Function,default:function(){return!0}},allowDrop:{type:Function,default:function(){return!0}},defaultText:{type:String,default:"New Node"},depth:{type:Number,default:0},disableDBClick:{type:Boolean,default:!1}},computed:{increaseDepth:function(){return this.depth+1},newData:{get:function(){return this.data},set:function(e){for(var t=this.data.length,n=0;nd;)if((a=c[d++])!=a)return!0}else for(;s>d;d++)if((e||d in c)&&c[d]===n)return e||d||0;return!e&&-1}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(18);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(4),o=n(3).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(3),o=n(1),i=n(22),u=n(26),a=n(7),c=function(e,t,n){var s,d,l,f=e&c.F,p=e&c.G,h=e&c.S,v=e&c.P,g=e&c.B,m=e&c.W,y=p?o:o[t]||(o[t]={}),_=y.prototype,b=p?r:h?r[t]:(r[t]||{}).prototype;p&&(n=t);for(s in n)(d=!f&&b&&void 0!==b[s])&&a(y,s)||(l=d?b[s]:n[s],y[s]=p&&"function"!=typeof b[s]?n[s]:g&&d?i(l,r):m&&b[s]==l?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(l):v&&"function"==typeof l?i(Function.call,l):l,v&&((y.virtual||(y.virtual={}))[s]=l,e&c.R&&_&&!_[s]&&u(_,s,l)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){var r=n(30),o=n(35);e.exports=n(0)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){e.exports=!n(0)&&!n(2)(function(){return 7!=Object.defineProperty(n(23)("div"),"a",{get:function(){return 7}}).a})},function(e,t){e.exports=!0},function(e,t,n){"use strict";var r=n(0),o=n(33),i=n(31),u=n(34),a=n(40),c=n(8),s=Object.assign;e.exports=!s||n(2)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=s({},e)[n]||Object.keys(s({},t)).join("")!=r})?function(e,t){for(var n=a(e),s=arguments.length,d=1,l=i.f,f=u.f;s>d;)for(var p,h=c(arguments[d++]),v=l?o(h).concat(l(h)):o(h),g=v.length,m=0;g>m;)p=v[m++],r&&!f.call(h,p)||(n[p]=h[p]);return n}:s},function(e,t,n){var r=n(19),o=n(27),i=n(41),u=Object.defineProperty;t.f=n(0)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return u(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(7),o=n(10),i=n(20)(!1),u=n(36)("IE_PROTO");e.exports=function(e,t){var n,a=o(e),c=0,s=[];for(n in a)n!=u&&r(a,n)&&s.push(n);for(;t.length>c;)r(a,n=t[c++])&&(~i(s,n)||s.push(n));return s}},function(e,t,n){var r=n(32),o=n(24);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(37)("keys"),o=n(42);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t,n){var r=n(1),o=n(3),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(28)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var r=n(9),o=Math.max,i=Math.min;e.exports=function(e,t){return e=r(e),e<0?o(e+t,0):i(e,t)}},function(e,t,n){var r=n(9),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(6);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(4);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(25);r(r.S+r.F,"Object",{assign:n(29)})},function(e,t){},function(e,t,n){function r(e){o||n(44)}var o=!1,i=n(11)(n(13),n(47),r,null,null);i.options.__file="/Users/shuirong/Code/vue-drag-tree/src/DragNode.vue",i.esModule&&Object.keys(i.esModule).some(function(e){return"default"!==e&&"__"!==e.substr(0,2)})&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] DragNode.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e._l(e.newData,function(t,r){return[n("drag-node",{key:r,attrs:{model:t,allowDrag:e.allowDrag,allowDrop:e.allowDrop,depth:e.increaseDepth,defaultText:e.defaultText,disableDBClick:e.disableDBClick},scopedSlots:e._u([{key:"default",fn:function(t){return[e._t("default",null,{nodeName:t.nodeName,isClicked:t.isClicked})]}}],null,!0)})]})],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"dnd-container",style:e.styleObj,attrs:{draggable:e.isDraggable},on:{drag:function(t){return t.stopPropagation(),e.drag(t)},dragstart:function(t){return t.stopPropagation(),e.dragStart(t)},dragover:function(t){return t.stopPropagation(),e.dragOver(t)},dragenter:function(t){return t.stopPropagation(),e.dragEnter(t)},dragleave:function(t){return t.stopPropagation(),e.dragLeave(t)},drop:function(t){return t.stopPropagation(),e.drop(t)},dragend:function(t){return t.stopPropagation(),e.dragEnd(t)}}},[n("div",{class:{"is-clicked":e.isClicked,"is-hover":e.isHover},on:{click:e.toggle,mouseover:e.mouseOver,mouseout:e.mouseOut,dblclick:e.changeType}},[n("div",{staticClass:"treeNodeText",style:{"padding-left":24*(this.depth-1)+"px"},attrs:{id:e.model.id}},[e._t("default",[n("span",{class:[e.isClicked?"nodeClicked":"",e.model.children&&e.model.children.length>0?"vue-drag-node-icon":"no-vue-drag-node-icon"]}),e._v(" "),n("span",{staticClass:"text"},[e._v(e._s(e.model.name))])],{nodeName:e.model.name,isClicked:e.isClicked})],2)]),e._v(" "),e.isFolder?n("div",{directives:[{name:"show",rawName:"v-show",value:e.open,expression:"open"}],staticClass:"treeMargin"},e._l(e.model.children,function(t){return n("drag-node",{key:t.id,attrs:{allowDrag:e.allowDrag,allowDrop:e.allowDrop,depth:e.increaseDepth,model:t,defaultText:e.defaultText,disableDBClick:e.disableDBClick}})}),1):e._e()])},staticRenderFns:[]},e.exports.render._withStripped=!0}])}); 2 | //# sourceMappingURL=vue-drag-tree.min.js.map -------------------------------------------------------------------------------- /dist/vue-drag-tree.min.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 4f8162badaae54108fb0","webpack:///vue-drag-tree.min.js","webpack:///./~/core-js/library/modules/_descriptors.js","webpack:///./~/core-js/library/modules/_core.js","webpack:///./~/core-js/library/modules/_fails.js","webpack:///./~/core-js/library/modules/_global.js","webpack:///./~/core-js/library/modules/_is-object.js","webpack:///./~/babel-runtime/core-js/object/assign.js","webpack:///./~/core-js/library/modules/_defined.js","webpack:///./~/core-js/library/modules/_has.js","webpack:///./~/core-js/library/modules/_iobject.js","webpack:///./~/core-js/library/modules/_to-integer.js","webpack:///./~/core-js/library/modules/_to-iobject.js","webpack:///./~/vue-loader/lib/component-normalizer.js","webpack:///./src/VueDragTree.vue","webpack:///DragNode.vue","webpack:///VueDragTree.vue","webpack:///./src/index.js","webpack:///./src/util.js","webpack:///./~/core-js/library/fn/object/assign.js","webpack:///./~/core-js/library/modules/_a-function.js","webpack:///./~/core-js/library/modules/_an-object.js","webpack:///./~/core-js/library/modules/_array-includes.js","webpack:///./~/core-js/library/modules/_cof.js","webpack:///./~/core-js/library/modules/_ctx.js","webpack:///./~/core-js/library/modules/_dom-create.js","webpack:///./~/core-js/library/modules/_enum-bug-keys.js","webpack:///./~/core-js/library/modules/_export.js","webpack:///./~/core-js/library/modules/_hide.js","webpack:///./~/core-js/library/modules/_ie8-dom-define.js","webpack:///./~/core-js/library/modules/_library.js","webpack:///./~/core-js/library/modules/_object-assign.js","webpack:///./~/core-js/library/modules/_object-dp.js","webpack:///./~/core-js/library/modules/_object-gops.js","webpack:///./~/core-js/library/modules/_object-keys-internal.js","webpack:///./~/core-js/library/modules/_object-keys.js","webpack:///./~/core-js/library/modules/_object-pie.js","webpack:///./~/core-js/library/modules/_property-desc.js","webpack:///./~/core-js/library/modules/_shared-key.js","webpack:///./~/core-js/library/modules/_shared.js","webpack:///./~/core-js/library/modules/_to-absolute-index.js","webpack:///./~/core-js/library/modules/_to-length.js","webpack:///./~/core-js/library/modules/_to-object.js","webpack:///./~/core-js/library/modules/_to-primitive.js","webpack:///./~/core-js/library/modules/_uid.js","webpack:///./~/core-js/library/modules/es6.object.assign.js","webpack:///./src/DragNode.vue?48c5","webpack:///./src/VueDragTree.vue?5b1a","webpack:///./src/DragNode.vue?d51d"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","moduleId","installedModules","i","l","modules","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","a","core","version","__e","exec","e","global","window","Math","self","Function","__g","it","undefined","TypeError","key","cof","propertyIsEnumerable","split","ceil","floor","isNaN","IObject","defined","rawScriptExports","compiledTemplate","injectStyles","scopeId","moduleIdentifier","esModule","scriptExports","type","default","options","render","staticRenderFns","_scopeId","hook","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","functional","existing","beforeCreate","h","concat","Component","__file","keys","some","substr","console","error","__webpack_exports__","__WEBPACK_IMPORTED_MODULE_0__util__","data","open","isClicked","isHover","styleObj","opacity","props","model","allowDrag","allowDrop","defaultText","String","depth","Number","disableDBClick","Boolean","computed","isFolder","children","length","increaseDepth","isDraggable","methods","toggle","rootTree","emitCurNodeClicked","nodeClicked","id","nodeStack","item","$children","changeType","currentHighlight","$set","addChild","mouseOver","mouseOut","push","removeChild","parent_model_children","index","splice","drag","fromData","emitDrag","dragStart","dataTransfer","effectAllowed","setData","dragOver","preventDefault","emitDragOver","dragEnter","_uid","emitDragEnter","dragLeave","emitDragLeave","drop","toData","emitDrop","dragEnd","emitDragEnd","created","__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign__","__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign___default","__WEBPACK_IMPORTED_MODULE_1__DragNode__","__WEBPACK_IMPORTED_MODULE_1__DragNode___default","Array","newData","set","shift","$emit","component","components","DragNode","VueDragTreeComponent","install","Vue","VueDragTree","findRoot","exchangeData","which","ok","that","$options","_componentTag","$parent","hasInclude","from","to","isLinealRelation","status","rootCom","newFrom","tempParent","toModel","filter","toParentModel","fromParentModel","assign","isObject","toIObject","toLength","toAbsoluteIndex","IS_INCLUDES","$this","el","fromIndex","O","toString","slice","aFunction","fn","b","apply","arguments","document","is","createElement","ctx","hide","has","$export","source","own","out","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","S","IS_PROTO","P","IS_BIND","B","IS_WRAP","W","expProto","target","C","virtual","R","U","dP","createDesc","f","DESCRIPTORS","getKeys","gOPS","pIE","toObject","$assign","A","Symbol","K","forEach","k","join","T","aLen","getSymbols","isEnum","j","anObject","IE8_DOM_DEFINE","toPrimitive","Attributes","getOwnPropertySymbols","arrayIndexOf","IE_PROTO","names","result","$keys","enumBugKeys","bitmap","writable","shared","uid","store","mode","copyright","toInteger","max","min","val","valueOf","px","random","injectStyle","disposed","_vm","_h","$createElement","_c","_self","_l","attrs","scopedSlots","_u","slotProps","_t","nodeName","_withStripped","staticClass","style","on","$event","stopPropagation","class","_v","_s","directives","rawName","expression","item2","_e"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,IACQ,kBAAXG,SAAyBA,OAAOC,IAC9CD,OAAO,iBAAmBH,GACA,gBAAZC,SACdA,QAAqB,YAAID,IAEzBD,EAAkB,YAAIC,KACrBK,KAAM,WACT,M,aCNE,QAASC,GAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUN,OAGnC,IAAIC,GAASM,EAAiBD,IAC7BE,EAAGF,EACHG,GAAG,EACHT,WAUD,OANAU,GAAQJ,GAAUK,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASK,GAG/DJ,EAAOQ,GAAI,EAGJR,EAAOD,QAvBf,GAAIO,KA+DJ,OAnCAF,GAAoBO,EAAIF,EAGxBL,EAAoBQ,EAAIN,EAGxBF,EAAoBG,EAAI,SAASM,GAAS,MAAOA,IAGjDT,EAAoBU,EAAI,SAASf,EAASgB,EAAMC,GAC3CZ,EAAoBa,EAAElB,EAASgB,IAClCG,OAAOC,eAAepB,EAASgB,GAC9BK,cAAc,EACdC,YAAY,EACZC,IAAKN,KAMRZ,EAAoBmB,EAAI,SAASvB,GAChC,GAAIgB,GAAShB,GAAUA,EAAOwB,WAC7B,WAAwB,MAAOxB,GAAgB,SAC/C,WAA8B,MAAOA,GAEtC,OADAI,GAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASQ,EAAQC,GAAY,MAAOR,QAAOS,UAAUC,eAAelB,KAAKe,EAAQC,IAGzGtB,EAAoByB,EAAI,GAGjBzB,EAAoBA,EAAoB0B,EAAI,MCgB/C,SAAU9B,EAAQD,EAASK,GC/EjCJ,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M,IACE,MAASf,EAAIxK,OACb,UAAawK,EAAI5J,UACjB,SAAY4J,EAAI3J,SAChB,SAAY2J,EAAIhK,cAEhBmK,EAAG,OACLU,YAAa,eACbC,OACE,eAAmC,IAAlBrS,KAAKoG,MAAQ,GAAU,MAE1CyL,OACE,GAAMN,EAAIxL,MAAMoB,MAEhBoK,EAAIU,GAAG,WAAYP,EAAG,QACxBe,OACElB,EAAI7L,UAAY,cAAgB,GAChC6L,EAAIxL,MAAMW,UAAY6K,EAAIxL,MAAMW,SAASC,OAAS,EAClD,qBACA,2BACA4K,EAAImB,GAAG,KAAMhB,EAAG,QAClBU,YAAa,SACXb,EAAImB,GAAGnB,EAAIoB,GAAGpB,EAAIxL,MAAMnF,WAC1B,SAAY2Q,EAAIxL,MAAMnF,KACtB,UAAa2Q,EAAI7L,aACd,KAAM6L,EAAImB,GAAG,KAAOnB,EAAY,SAAIG,EAAG,OAC1CkB,aACEhS,KAAM,OACNiS,QAAS,SACTnS,MAAQ6Q,EAAQ,KAChBuB,WAAY,SAEdV,YAAa,cACZb,EAAIK,GAAIL,EAAIxL,MAAc,SAAG,SAASgN,GACvC,MAAOrB,GAAG,aACR/O,IAAKoQ,EAAM5L,GACX0K,OACE,UAAaN,EAAIvL,UACjB,UAAauL,EAAItL,UACjB,MAASsL,EAAI3K,cACb,MAASmM,EACT,YAAexB,EAAIrL,YACnB,eAAkBqL,EAAIjL,oBAGxB,GAAKiL,EAAIyB,QACbjP,oBACFlE,EAAOD,QAAQkE,OAAOqO,eAAgB","file":"vue-drag-tree.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"VueDragTree\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VueDragTree\"] = factory();\n\telse\n\t\troot[\"VueDragTree\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 15);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4f8162badaae54108fb0","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"VueDragTree\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VueDragTree\"] = factory();\n\telse\n\t\troot[\"VueDragTree\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 15);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(2)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nvar core = module.exports = { version: '2.6.11' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = { \"default\": __webpack_require__(17), __esModule: true };\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports) {\n\nvar hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(21);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(8);\nvar defined = __webpack_require__(6);\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports) {\n\n/* globals __VUE_SSR_CONTEXT__ */\n\n// this module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle\n\nmodule.exports = function normalizeComponent (\n rawScriptExports,\n compiledTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */\n) {\n var esModule\n var scriptExports = rawScriptExports = rawScriptExports || {}\n\n // ES6 modules interop\n var type = typeof rawScriptExports.default\n if (type === 'object' || type === 'function') {\n esModule = rawScriptExports\n scriptExports = rawScriptExports.default\n }\n\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (compiledTemplate) {\n options.render = compiledTemplate.render\n options.staticRenderFns = compiledTemplate.staticRenderFns\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = injectStyles\n }\n\n if (hook) {\n var functional = options.functional\n var existing = functional\n ? options.render\n : options.beforeCreate\n if (!functional) {\n // inject component registration as beforeCreate hook\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n } else {\n // register for functioal component in vue file\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return existing(h, context)\n }\n }\n }\n\n return {\n esModule: esModule,\n exports: scriptExports,\n options: options\n }\n}\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar disposed = false\nvar Component = __webpack_require__(11)(\n /* script */\n __webpack_require__(14),\n /* template */\n __webpack_require__(46),\n /* styles */\n null,\n /* scopeId */\n null,\n /* moduleIdentifier (server only) */\n null\n)\nComponent.options.__file = \"/Users/shuirong/Code/vue-drag-tree/src/VueDragTree.vue\"\nif (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== \"default\" && key.substr(0, 2) !== \"__\"})) {console.error(\"named exports are not supported in *.vue files.\")}\nif (Component.options.functional) {console.error(\"[vue-loader] VueDragTree.vue: functional components are not supported with templates, they should use render functions.\")}\n\n/* hot reload */\nif (false) {(function () {\n var hotAPI = require(\"vue-hot-reload-api\")\n hotAPI.install(require(\"vue\"), false)\n if (!hotAPI.compatible) return\n module.hot.accept()\n if (!module.hot.data) {\n hotAPI.createRecord(\"data-v-3ce33630\", Component.options)\n } else {\n hotAPI.reload(\"data-v-3ce33630\", Component.options)\n }\n module.hot.dispose(function (data) {\n disposed = true\n })\n})()}\n\nmodule.exports = Component.exports\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(16);\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nvar id = 1000;\nvar fromData = null;\nvar toData = null;\nvar nodeClicked = undefined; // Attention: 递归的所有组件共享同一个"顶级作用域"(这个词或许不太正确,但就这个意思).即:共享上面这几个let变量.这为实现当前节点的高亮提供了基础.\nvar rootTree = null; // vue-drag-tree组件引用\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"DragNode\",\n data: function data() {\n return {\n open: false,\n isClicked: false, // 当前节点被点击\n isHover: false, // 当前节点被hvoer\n styleObj: {\n //节点样式\n opacity: 1\n }\n };\n },\n\n props: {\n model: Object,\n allowDrag: {\n type: Function,\n default: function _default() {\n return true;\n }\n },\n allowDrop: {\n type: Function,\n default: function _default() {\n return true;\n }\n },\n defaultText: {\n // 填加节点时显示的默认文本.\n type: String,\n default: \"New Node\"\n },\n depth: {\n type: Number,\n default: 0\n },\n disableDBClick: {\n type: Boolean,\n default: false\n }\n },\n computed: {\n isFolder: function isFolder() {\n return this.model.children && this.model.children.length;\n },\n increaseDepth: function increaseDepth() {\n return this.depth + 1;\n },\n isDraggable: function isDraggable() {\n return this.allowDrag(this.model, this);\n }\n },\n methods: {\n toggle: function toggle() {\n if (this.isFolder) {\n this.open = !this.open;\n }\n // 调用vue-drag-tree的父组件中的方法,以传递出当前被点击的节点的id值\n // API: 对外开放的当前被点击节点的信息\n rootTree.emitCurNodeClicked(this.model, this);\n\n // 纪录节点被点击的状态\n this.isClicked = !this.isClicked;\n\n // 用户需要节点高亮\n // 第一次点击当前节点.当前节点高亮,遍历重置其他节点的样式\n if (nodeClicked != this.model.id) {\n var treeParent = rootTree.$parent;\n\n // 遍历重置所有树组件的高亮样式\n var nodeStack = [treeParent.$children[0]];\n while (nodeStack.length != 0) {\n var item = nodeStack.shift();\n item.isClicked = false;\n if (item.$children && item.$children.length > 0) {\n nodeStack = nodeStack.concat(item.$children);\n }\n }\n // 然后把当前节点的样式设置为高亮\n this.isClicked = true;\n\n // 设置节点为 当前节点\n nodeClicked = this.model.id;\n }\n },\n changeType: function changeType() {\n // 如果用户禁用了双击增加item,什么都不做\n if (this.disableDBClick) {\n return;\n }\n // 用户需要高亮-->才纪录当前被点击节点\n if (this.currentHighlight) {\n nodeClicked = this.model.id;\n }\n if (!this.isFolder) {\n this.$set(this.model, \"children\", []);\n this.addChild();\n this.open = true;\n this.isClicked = true;\n }\n },\n mouseOver: function mouseOver(e) {\n this.isHover = true;\n },\n mouseOut: function mouseOut(e) {\n this.isHover = false;\n },\n addChild: function addChild() {\n this.model.children.push({\n name: this.defaultText,\n id: id++\n });\n },\n removeChild: function removeChild(id) {\n // 获取父组件的model.children\n var parent_model_children = this.$parent.model.children;\n\n // 在父组件model.children里删除\n for (var index in parent_model_children) {\n // 找到该删的id\n if (parent_model_children[index].id == id) {\n parent_model_children = parent_model_children.splice(index, 1);\n break;\n }\n }\n },\n drag: function drag(e) {\n fromData = this;\n rootTree.emitDrag(this.model, this, e);\n },\n dragStart: function dragStart(e) {\n e.dataTransfer.effectAllowed = \"move\";\n e.dataTransfer.setData(\"text/plain\", \"asdad\");\n return true;\n },\n dragOver: function dragOver(e) {\n e.preventDefault();\n rootTree.emitDragOver(this.model, this, e);\n return true;\n },\n dragEnter: function dragEnter(e) {\n if (this._uid !== fromData._uid) {\n this.styleObj.opacity = 0.5;\n }\n rootTree.emitDragEnter(this.model, this, e);\n },\n dragLeave: function dragLeave(e) {\n this.styleObj.opacity = 1;\n rootTree.emitDragLeave(this.model, this, e);\n },\n drop: function drop(e) {\n e.preventDefault();\n this.styleObj.opacity = 1;\n // 如果判断当前节点不允许被drop,return;\n if (!this.allowDrop(this.model, this)) {\n return;\n }\n toData = this;\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__[\"a\" /* exchangeData */])(rootTree, fromData, toData);\n rootTree.emitDrop(this.model, this, e);\n },\n dragEnd: function dragEnd(e) {\n rootTree.emitDragEnd(this.model, this, e);\n return;\n }\n },\n created: function created() {\n rootTree = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util__[\"b\" /* findRoot */])(this);\n }\n});\n\n/***/ }),\n/* 14 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign__ = __webpack_require__(5);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__DragNode__ = __webpack_require__(45);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__DragNode___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__DragNode__);\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"VueDragTree\",\n props: {\n data: Array,\n allowDrag: {\n type: Function,\n default: function _default() {\n return true;\n }\n },\n allowDrop: {\n type: Function,\n default: function _default() {\n return true;\n }\n },\n defaultText: {\n // 填加节点时显示的默认文本.\n type: String,\n default: \"New Node\"\n },\n depth: {\n type: Number,\n default: 0\n },\n disableDBClick: {\n // 禁用双击增加新的item\n type: Boolean,\n default: false\n }\n },\n computed: {\n increaseDepth: function increaseDepth() {\n return this.depth + 1;\n },\n\n newData: {\n // getter\n get: function get() {\n return this.data;\n },\n\n // setter\n set: function set(newValue) {\n // 移除原属性内部所有的值,为了要一个“干净”的引用对象。\n var length = this.data.length;\n for (var i = 0; i < length; i++) {\n this.data.shift(i);\n }\n // 然后利用对象深拷贝(返回target的引用),因此控制台不会报错~\n this.data = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign___default()(this.data, newValue);\n }\n }\n },\n methods: {\n emitCurNodeClicked: function emitCurNodeClicked(model, component) {\n this.$emit(\"current-node-clicked\", model, component);\n },\n emitDrag: function emitDrag(model, component, e) {\n this.$emit(\"drag\", model, component, e);\n },\n emitDragEnter: function emitDragEnter(model, component, e) {\n this.$emit(\"drag-enter\", model, component, e);\n },\n emitDragLeave: function emitDragLeave(model, component, e) {\n this.$emit(\"drag-leave\", model, component, e);\n },\n emitDragOver: function emitDragOver(model, component, e) {\n this.$emit(\"drag-over\", model, component, e);\n },\n emitDragEnd: function emitDragEnd(model, component, e) {\n this.$emit(\"drag-end\", model, component, e);\n },\n emitDrop: function emitDrop(model, component, e) {\n this.$emit(\"drop\", model, component, e);\n }\n },\n components: {\n DragNode: __WEBPACK_IMPORTED_MODULE_1__DragNode___default.a\n }\n});\n\n/***/ }),\n/* 15 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__VueDragTree_vue__ = __webpack_require__(12);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__VueDragTree_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__VueDragTree_vue__);\n\n\nvar VueDragTreeComponent = {\n install: function install(Vue) {\n if (typeof window !== 'undefined' && window.Vue) {\n Vue = window.Vue;\n }\n Vue.component('VueDragTree', __WEBPACK_IMPORTED_MODULE_0__VueDragTree_vue___default.a);\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (VueDragTreeComponent);\n\n/***/ }),\n/* 16 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return findRoot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return exchangeData; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign__ = __webpack_require__(5);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign__);\n\n// 返回最顶层那个vue-drag-tree.vue组件\nvar findRoot = function findRoot(which) {\n var ok = false;\n var that = which;\n while (!ok) {\n // 根据组件name来判断\n if (that.$options._componentTag === \"vue-drag-tree\") {\n ok = true;\n // 交换两者的数据\n break;\n }\n that = that.$parent;\n }\n return that;\n};\n\n/**\n * 是否两节点为包含关系\n * 即:直系父与子的关系\n * P.S. 解决from祖父节点拖到子孙节点时元素消失的bug\n * https://github.com/shuiRong/vue-drag-tree/issues/32\n */\nvar hasInclude = function hasInclude(from, to) {\n while (from.$parent != undefined) {\n if (from.$parent._uid === to._uid) {\n return true;\n } else {\n from = from.$parent;\n }\n }\n return false;\n};\n\n/**\n * 两节点为直线关系?\n * 即:from为to的某个子集,但又不是父子关系?\n */\nvar isLinealRelation = function isLinealRelation(from, to) {\n var parent = from.$parent;\n\n // 判断完成,不管是什么结果\n var ok = false;\n // 是直线关系?\n var status = false;\n while (!ok) {\n if (parent._uid === to._uid) {\n ok = true;\n status = true;\n continue;\n }\n if (!parent.$options._componentTag || parent.$options._componentTag === \"vue-drag-tree\") {\n // 如果检测到这里,就该结束了。\n ok = true;\n break;\n }\n parent = parent.$parent;\n }\n\n return status;\n};\n\n/**\n * 交换两节点数据\n * @param rootCom 根组件(vue-drag-tree.vue)\n * @param from 被拖拽节点组件Vnode数据\n * @param to 拖拽节点组件Vnode数据\n */\nvar exchangeData = function exchangeData(rootCom, from, to) {\n // 如果拖动节点和被拖动节点相同,return;\n if (from._uid === to._uid) {\n return;\n }\n\n // 如果两者是父子关系且from是父节点,to是子节点,什么都不做\n if (hasInclude(to, from)) {\n return;\n }\n\n var newFrom = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_assign___default()({}, from.model);\n\n // 如果两者是父子关系。将from节点,移动到to节点一级且放到其后一位\n if (hasInclude(from, to)) {\n // 如果“父”是最上层节点(节点数组中的最外层数据)\n var tempParent = to.$parent;\n var _toModel = to.model;\n\n if (tempParent.$options._componentTag === \"vue-drag-tree\") {\n // 将from节点添加到 根数组中\n tempParent.newData.push(newFrom);\n // 移除to中from节点信息;\n _toModel.children = _toModel.children.filter(function (item) {\n return item.id !== newFrom.id;\n });\n return;\n }\n\n var toParentModel = tempParent.model;\n // 先移除to中from节点信息;\n _toModel.children = _toModel.children.filter(function (item) {\n return item.id !== newFrom.id;\n });\n // 将 from节点 添加到 to 一级别中。\n toParentModel.children = toParentModel.children.concat([newFrom]);\n return;\n }\n\n // 如果是 线性 关系,但非父子\n if (isLinealRelation(from, to)) {\n var _fromParentModel = from.$parent.model;\n var _toModel2 = to.model;\n\n // 先将from从其父节点信息移除;\n _fromParentModel.children = _fromParentModel.children.filter(function (item) {\n return item.id !== newFrom.id;\n });\n\n // 再from节点添加到to节点中最后一位。\n _toModel2.children = _toModel2.children.concat([newFrom]);\n return;\n }\n\n // 两节点(无线性关系),把from节点扔到to节点中。\n var fromParentModel = from.$parent.model;\n var toModel = to.model;\n // 先将from从其父节点信息移除;\n if (from.$parent.$options._componentTag === \"vue-drag-tree\") {\n /**\n * 找到vue-drag-tree的父组件(数据源头),在这里修改数据。\n */\n from.$parent.newData = from.$parent.newData.filter(function (item) {\n return item.id !== newFrom.id;\n });\n } else {\n fromParentModel.children = fromParentModel.children.filter(function (item) {\n return item.id !== newFrom.id;\n });\n }\n\n // 再from节点添加到to节点中最后一位。\n if (!toModel.children) {\n toModel.children = [newFrom];\n } else {\n toModel.children = toModel.children.concat([newFrom]);\n }\n};\n\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(43);\nmodule.exports = __webpack_require__(1).Object.assign;\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(4);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(10);\nvar toLength = __webpack_require__(39);\nvar toAbsoluteIndex = __webpack_require__(38);\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports) {\n\nvar toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// optional / simple context binding\nvar aFunction = __webpack_require__(18);\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(4);\nvar document = __webpack_require__(3).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports) {\n\n// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(3);\nvar core = __webpack_require__(1);\nvar ctx = __webpack_require__(22);\nvar hide = __webpack_require__(26);\nvar has = __webpack_require__(7);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dP = __webpack_require__(30);\nvar createDesc = __webpack_require__(35);\nmodule.exports = __webpack_require__(0) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = !__webpack_require__(0) && !__webpack_require__(2)(function () {\n return Object.defineProperty(__webpack_require__(23)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports) {\n\nmodule.exports = true;\n\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 19.1.2.1 Object.assign(target, source, ...)\nvar DESCRIPTORS = __webpack_require__(0);\nvar getKeys = __webpack_require__(33);\nvar gOPS = __webpack_require__(31);\nvar pIE = __webpack_require__(34);\nvar toObject = __webpack_require__(40);\nvar IObject = __webpack_require__(8);\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || __webpack_require__(2)(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : $assign;\n\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar anObject = __webpack_require__(19);\nvar IE8_DOM_DEFINE = __webpack_require__(27);\nvar toPrimitive = __webpack_require__(41);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(0) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports) {\n\nexports.f = Object.getOwnPropertySymbols;\n\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar has = __webpack_require__(7);\nvar toIObject = __webpack_require__(10);\nvar arrayIndexOf = __webpack_require__(20)(false);\nvar IE_PROTO = __webpack_require__(36)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(32);\nvar enumBugKeys = __webpack_require__(24);\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports) {\n\nexports.f = {}.propertyIsEnumerable;\n\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar shared = __webpack_require__(37)('keys');\nvar uid = __webpack_require__(42);\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar core = __webpack_require__(1);\nvar global = __webpack_require__(3);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: __webpack_require__(28) ? 'pure' : 'global',\n copyright: '© 2019 Denis Pushkarev (zloirock.ru)'\n});\n\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar toInteger = __webpack_require__(9);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.15 ToLength\nvar toInteger = __webpack_require__(9);\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(6);\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(4);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports) {\n\nvar id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.3.1 Object.assign(target, source)\nvar $export = __webpack_require__(25);\n\n$export($export.S + $export.F, 'Object', { assign: __webpack_require__(29) });\n\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 45 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar disposed = false\nfunction injectStyle (ssrContext) {\n if (disposed) return\n __webpack_require__(44)\n}\nvar Component = __webpack_require__(11)(\n /* script */\n __webpack_require__(13),\n /* template */\n __webpack_require__(47),\n /* styles */\n injectStyle,\n /* scopeId */\n null,\n /* moduleIdentifier (server only) */\n null\n)\nComponent.options.__file = \"/Users/shuirong/Code/vue-drag-tree/src/DragNode.vue\"\nif (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== \"default\" && key.substr(0, 2) !== \"__\"})) {console.error(\"named exports are not supported in *.vue files.\")}\nif (Component.options.functional) {console.error(\"[vue-loader] DragNode.vue: functional components are not supported with templates, they should use render functions.\")}\n\n/* hot reload */\nif (false) {(function () {\n var hotAPI = require(\"vue-hot-reload-api\")\n hotAPI.install(require(\"vue\"), false)\n if (!hotAPI.compatible) return\n module.hot.accept()\n if (!module.hot.data) {\n hotAPI.createRecord(\"data-v-595cdfee\", Component.options)\n } else {\n hotAPI.reload(\"data-v-595cdfee\", Component.options)\n }\n module.hot.dispose(function (data) {\n disposed = true\n })\n})()}\n\nmodule.exports = Component.exports\n\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', [_vm._l((_vm.newData), function(item, index) {\n return [_c('drag-node', {\n key: index,\n attrs: {\n \"model\": item,\n \"allowDrag\": _vm.allowDrag,\n \"allowDrop\": _vm.allowDrop,\n \"depth\": _vm.increaseDepth,\n \"defaultText\": _vm.defaultText,\n \"disableDBClick\": _vm.disableDBClick\n },\n scopedSlots: _vm._u([{\n key: \"default\",\n fn: function(slotProps) {\n return [_vm._t(\"default\", null, {\n \"nodeName\": slotProps.nodeName,\n \"isClicked\": slotProps.isClicked\n })]\n }\n }], null, true)\n })]\n })], 2)\n},staticRenderFns: []}\nmodule.exports.render._withStripped = true\nif (false) {\n module.hot.accept()\n if (module.hot.data) {\n require(\"vue-hot-reload-api\").rerender(\"data-v-3ce33630\", module.exports)\n }\n}\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n staticClass: \"dnd-container\",\n style: (_vm.styleObj),\n attrs: {\n \"draggable\": _vm.isDraggable\n },\n on: {\n \"drag\": function($event) {\n $event.stopPropagation();\n return _vm.drag($event)\n },\n \"dragstart\": function($event) {\n $event.stopPropagation();\n return _vm.dragStart($event)\n },\n \"dragover\": function($event) {\n $event.stopPropagation();\n return _vm.dragOver($event)\n },\n \"dragenter\": function($event) {\n $event.stopPropagation();\n return _vm.dragEnter($event)\n },\n \"dragleave\": function($event) {\n $event.stopPropagation();\n return _vm.dragLeave($event)\n },\n \"drop\": function($event) {\n $event.stopPropagation();\n return _vm.drop($event)\n },\n \"dragend\": function($event) {\n $event.stopPropagation();\n return _vm.dragEnd($event)\n }\n }\n }, [_c('div', {\n class: {\n 'is-clicked': _vm.isClicked, 'is-hover': _vm.isHover\n },\n on: {\n \"click\": _vm.toggle,\n \"mouseover\": _vm.mouseOver,\n \"mouseout\": _vm.mouseOut,\n \"dblclick\": _vm.changeType\n }\n }, [_c('div', {\n staticClass: \"treeNodeText\",\n style: ({\n 'padding-left': (this.depth - 1) * 24 + 'px'\n }),\n attrs: {\n \"id\": _vm.model.id\n }\n }, [_vm._t(\"default\", [_c('span', {\n class: [\n _vm.isClicked ? 'nodeClicked' : '',\n _vm.model.children && _vm.model.children.length > 0 ?\n 'vue-drag-node-icon' :\n 'no-vue-drag-node-icon' ]\n }), _vm._v(\" \"), _c('span', {\n staticClass: \"text\"\n }, [_vm._v(_vm._s(_vm.model.name))])], {\n \"nodeName\": _vm.model.name,\n \"isClicked\": _vm.isClicked\n })], 2)]), _vm._v(\" \"), (_vm.isFolder) ? _c('div', {\n directives: [{\n name: \"show\",\n rawName: \"v-show\",\n value: (_vm.open),\n expression: \"open\"\n }],\n staticClass: \"treeMargin\"\n }, _vm._l((_vm.model.children), function(item2) {\n return _c('drag-node', {\n key: item2.id,\n attrs: {\n \"allowDrag\": _vm.allowDrag,\n \"allowDrop\": _vm.allowDrop,\n \"depth\": _vm.increaseDepth,\n \"model\": item2,\n \"defaultText\": _vm.defaultText,\n \"disableDBClick\": _vm.disableDBClick\n }\n })\n }), 1) : _vm._e()])\n},staticRenderFns: []}\nmodule.exports.render._withStripped = true\nif (false) {\n module.hot.accept()\n if (module.hot.data) {\n require(\"vue-hot-reload-api\").rerender(\"data-v-595cdfee\", module.exports)\n }\n}\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// vue-drag-tree.min.js","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_descriptors.js\n// module id = 0\n// module chunks = 0","var core = module.exports = { version: '2.6.11' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_core.js\n// module id = 1\n// module chunks = 0","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_fails.js\n// module id = 2\n// module chunks = 0","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_global.js\n// module id = 3\n// module chunks = 0","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_is-object.js\n// module id = 4\n// module chunks = 0","module.exports = { \"default\": require(\"core-js/library/fn/object/assign\"), __esModule: true };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/object/assign.js\n// module id = 5\n// module chunks = 0","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_defined.js\n// module id = 6\n// module chunks = 0","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_has.js\n// module id = 7\n// module chunks = 0","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_iobject.js\n// module id = 8\n// module chunks = 0","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-integer.js\n// module id = 9\n// module chunks = 0","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-iobject.js\n// module id = 10\n// module chunks = 0","/* globals __VUE_SSR_CONTEXT__ */\n\n// this module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle\n\nmodule.exports = function normalizeComponent (\n rawScriptExports,\n compiledTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */\n) {\n var esModule\n var scriptExports = rawScriptExports = rawScriptExports || {}\n\n // ES6 modules interop\n var type = typeof rawScriptExports.default\n if (type === 'object' || type === 'function') {\n esModule = rawScriptExports\n scriptExports = rawScriptExports.default\n }\n\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (compiledTemplate) {\n options.render = compiledTemplate.render\n options.staticRenderFns = compiledTemplate.staticRenderFns\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = injectStyles\n }\n\n if (hook) {\n var functional = options.functional\n var existing = functional\n ? options.render\n : options.beforeCreate\n if (!functional) {\n // inject component registration as beforeCreate hook\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n } else {\n // register for functioal component in vue file\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return existing(h, context)\n }\n }\n }\n\n return {\n esModule: esModule,\n exports: scriptExports,\n options: options\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/component-normalizer.js\n// module id = 11\n// module chunks = 0","var disposed = false\nvar Component = require(\"!../node_modules/vue-loader/lib/component-normalizer\")(\n /* script */\n require(\"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./VueDragTree.vue\"),\n /* template */\n require(\"!!../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-3ce33630\\\",\\\"hasScoped\\\":false}!../node_modules/vue-loader/lib/selector?type=template&index=0!./VueDragTree.vue\"),\n /* styles */\n null,\n /* scopeId */\n null,\n /* moduleIdentifier (server only) */\n null\n)\nComponent.options.__file = \"/Users/shuirong/Code/vue-drag-tree/src/VueDragTree.vue\"\nif (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== \"default\" && key.substr(0, 2) !== \"__\"})) {console.error(\"named exports are not supported in *.vue files.\")}\nif (Component.options.functional) {console.error(\"[vue-loader] VueDragTree.vue: functional components are not supported with templates, they should use render functions.\")}\n\n/* hot reload */\nif (module.hot) {(function () {\n var hotAPI = require(\"vue-hot-reload-api\")\n hotAPI.install(require(\"vue\"), false)\n if (!hotAPI.compatible) return\n module.hot.accept()\n if (!module.hot.data) {\n hotAPI.createRecord(\"data-v-3ce33630\", Component.options)\n } else {\n hotAPI.reload(\"data-v-3ce33630\", Component.options)\n }\n module.hot.dispose(function (data) {\n disposed = true\n })\n})()}\n\nmodule.exports = Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/VueDragTree.vue\n// module id = 12\n// module chunks = 0","\n \n \n \n \n 0\n ? 'vue-drag-node-icon'\n : 'no-vue-drag-node-icon',\n ]\"\n >\n {{ model.name }}\n \n \n \n \n \n \n \n\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// DragNode.vue?786e227c","\n \n \n \n \n \n \n \n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// VueDragTree.vue?2343c624","import VueDragTree from './VueDragTree.vue'\n\nconst VueDragTreeComponent = {\n install: function (Vue) {\n if (typeof window !== 'undefined' && window.Vue) {\n Vue = window.Vue\n }\n Vue.component('VueDragTree', VueDragTree)\n }\n}\n\nexport default VueDragTreeComponent\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","// 返回最顶层那个vue-drag-tree.vue组件\nconst findRoot = (which) => {\n let ok = false;\n let that = which;\n while (!ok) {\n // 根据组件name来判断\n if (that.$options._componentTag === \"vue-drag-tree\") {\n ok = true;\n // 交换两者的数据\n break;\n }\n that = that.$parent;\n }\n return that;\n};\n\n/**\n * 是否两节点为包含关系\n * 即:直系父与子的关系\n * P.S. 解决from祖父节点拖到子孙节点时元素消失的bug\n * https://github.com/shuiRong/vue-drag-tree/issues/32\n */\nconst hasInclude = (from, to) => {\n while (from.$parent != undefined) {\n if (from.$parent._uid === to._uid) {\n return true;\n } else {\n from = from.$parent;\n }\n }\n return false;\n};\n\n/**\n * 两节点为直线关系?\n * 即:from为to的某个子集,但又不是父子关系?\n */\nconst isLinealRelation = (from, to) => {\n let parent = from.$parent;\n\n // 判断完成,不管是什么结果\n let ok = false;\n // 是直线关系?\n let status = false;\n while (!ok) {\n if (parent._uid === to._uid) {\n ok = true;\n status = true;\n continue;\n }\n if (\n !parent.$options._componentTag ||\n parent.$options._componentTag === \"vue-drag-tree\"\n ) {\n // 如果检测到这里,就该结束了。\n ok = true;\n break;\n }\n parent = parent.$parent;\n }\n\n return status;\n};\n\n/**\n * 交换两节点数据\n * @param rootCom 根组件(vue-drag-tree.vue)\n * @param from 被拖拽节点组件Vnode数据\n * @param to 拖拽节点组件Vnode数据\n */\nconst exchangeData = (rootCom, from, to) => {\n // 如果拖动节点和被拖动节点相同,return;\n if (from._uid === to._uid) {\n return;\n }\n\n // 如果两者是父子关系且from是父节点,to是子节点,什么都不做\n if (hasInclude(to, from)) {\n return;\n }\n\n const newFrom = Object.assign({}, from.model);\n\n // 如果两者是父子关系。将from节点,移动到to节点一级且放到其后一位\n if (hasInclude(from, to)) {\n // 如果“父”是最上层节点(节点数组中的最外层数据)\n const tempParent = to.$parent;\n const toModel = to.model;\n\n if (tempParent.$options._componentTag === \"vue-drag-tree\") {\n // 将from节点添加到 根数组中\n tempParent.newData.push(newFrom);\n // 移除to中from节点信息;\n toModel.children = toModel.children.filter(\n (item) => item.id !== newFrom.id\n );\n return;\n }\n\n const toParentModel = tempParent.model;\n // 先移除to中from节点信息;\n toModel.children = toModel.children.filter(\n (item) => item.id !== newFrom.id\n );\n // 将 from节点 添加到 to 一级别中。\n toParentModel.children = toParentModel.children.concat([newFrom]);\n return;\n }\n\n // 如果是 线性 关系,但非父子\n if (isLinealRelation(from, to)) {\n const fromParentModel = from.$parent.model;\n const toModel = to.model;\n\n // 先将from从其父节点信息移除;\n fromParentModel.children = fromParentModel.children.filter(\n (item) => item.id !== newFrom.id\n );\n\n // 再from节点添加到to节点中最后一位。\n toModel.children = toModel.children.concat([newFrom]);\n return;\n }\n\n // 两节点(无线性关系),把from节点扔到to节点中。\n const fromParentModel = from.$parent.model;\n const toModel = to.model;\n // 先将from从其父节点信息移除;\n if (from.$parent.$options._componentTag === \"vue-drag-tree\") {\n /**\n * 找到vue-drag-tree的父组件(数据源头),在这里修改数据。\n */\n from.$parent.newData = from.$parent.newData.filter(\n (item) => item.id !== newFrom.id\n );\n } else {\n fromParentModel.children = fromParentModel.children.filter(\n (item) => item.id !== newFrom.id\n );\n }\n\n // 再from节点添加到to节点中最后一位。\n if (!toModel.children) {\n toModel.children = [newFrom];\n } else {\n toModel.children = toModel.children.concat([newFrom]);\n }\n};\n\nexport { findRoot, exchangeData };\n\n\n\n// WEBPACK FOOTER //\n// ./src/util.js","require('../../modules/es6.object.assign');\nmodule.exports = require('../../modules/_core').Object.assign;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/object/assign.js\n// module id = 17\n// module chunks = 0","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_a-function.js\n// module id = 18\n// module chunks = 0","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_an-object.js\n// module id = 19\n// module chunks = 0","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_array-includes.js\n// module id = 20\n// module chunks = 0","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_cof.js\n// module id = 21\n// module chunks = 0","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_ctx.js\n// module id = 22\n// module chunks = 0","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_dom-create.js\n// module id = 23\n// module chunks = 0","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_enum-bug-keys.js\n// module id = 24\n// module chunks = 0","var global = require('./_global');\nvar core = require('./_core');\nvar ctx = require('./_ctx');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_export.js\n// module id = 25\n// module chunks = 0","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_hide.js\n// module id = 26\n// module chunks = 0","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_ie8-dom-define.js\n// module id = 27\n// module chunks = 0","module.exports = true;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_library.js\n// module id = 28\n// module chunks = 0","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar DESCRIPTORS = require('./_descriptors');\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : $assign;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-assign.js\n// module id = 29\n// module chunks = 0","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-dp.js\n// module id = 30\n// module chunks = 0","exports.f = Object.getOwnPropertySymbols;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-gops.js\n// module id = 31\n// module chunks = 0","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-keys-internal.js\n// module id = 32\n// module chunks = 0","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-keys.js\n// module id = 33\n// module chunks = 0","exports.f = {}.propertyIsEnumerable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-pie.js\n// module id = 34\n// module chunks = 0","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_property-desc.js\n// module id = 35\n// module chunks = 0","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_shared-key.js\n// module id = 36\n// module chunks = 0","var core = require('./_core');\nvar global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: require('./_library') ? 'pure' : 'global',\n copyright: '© 2019 Denis Pushkarev (zloirock.ru)'\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_shared.js\n// module id = 37\n// module chunks = 0","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-absolute-index.js\n// module id = 38\n// module chunks = 0","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-length.js\n// module id = 39\n// module chunks = 0","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-object.js\n// module id = 40\n// module chunks = 0","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-primitive.js\n// module id = 41\n// module chunks = 0","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_uid.js\n// module id = 42\n// module chunks = 0","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.object.assign.js\n// module id = 43\n// module chunks = 0","var disposed = false\nfunction injectStyle (ssrContext) {\n if (disposed) return\n require(\"!!../node_modules/extract-text-webpack-plugin/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"minimize\\\":true,\\\"sourceMap\\\":true}!../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-595cdfee\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../node_modules/vue-loader/lib/selector?type=styles&index=0!./DragNode.vue\")\n}\nvar Component = require(\"!../node_modules/vue-loader/lib/component-normalizer\")(\n /* script */\n require(\"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./DragNode.vue\"),\n /* template */\n require(\"!!../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-595cdfee\\\",\\\"hasScoped\\\":false}!../node_modules/vue-loader/lib/selector?type=template&index=0!./DragNode.vue\"),\n /* styles */\n injectStyle,\n /* scopeId */\n null,\n /* moduleIdentifier (server only) */\n null\n)\nComponent.options.__file = \"/Users/shuirong/Code/vue-drag-tree/src/DragNode.vue\"\nif (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== \"default\" && key.substr(0, 2) !== \"__\"})) {console.error(\"named exports are not supported in *.vue files.\")}\nif (Component.options.functional) {console.error(\"[vue-loader] DragNode.vue: functional components are not supported with templates, they should use render functions.\")}\n\n/* hot reload */\nif (module.hot) {(function () {\n var hotAPI = require(\"vue-hot-reload-api\")\n hotAPI.install(require(\"vue\"), false)\n if (!hotAPI.compatible) return\n module.hot.accept()\n if (!module.hot.data) {\n hotAPI.createRecord(\"data-v-595cdfee\", Component.options)\n } else {\n hotAPI.reload(\"data-v-595cdfee\", Component.options)\n }\n module.hot.dispose(function (data) {\n disposed = true\n })\n})()}\n\nmodule.exports = Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/DragNode.vue\n// module id = 45\n// module chunks = 0","module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', [_vm._l((_vm.newData), function(item, index) {\n return [_c('drag-node', {\n key: index,\n attrs: {\n \"model\": item,\n \"allowDrag\": _vm.allowDrag,\n \"allowDrop\": _vm.allowDrop,\n \"depth\": _vm.increaseDepth,\n \"defaultText\": _vm.defaultText,\n \"disableDBClick\": _vm.disableDBClick\n },\n scopedSlots: _vm._u([{\n key: \"default\",\n fn: function(slotProps) {\n return [_vm._t(\"default\", null, {\n \"nodeName\": slotProps.nodeName,\n \"isClicked\": slotProps.isClicked\n })]\n }\n }], null, true)\n })]\n })], 2)\n},staticRenderFns: []}\nmodule.exports.render._withStripped = true\nif (module.hot) {\n module.hot.accept()\n if (module.hot.data) {\n require(\"vue-hot-reload-api\").rerender(\"data-v-3ce33630\", module.exports)\n }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/template-compiler?{\"id\":\"data-v-3ce33630\",\"hasScoped\":false}!./~/vue-loader/lib/selector.js?type=template&index=0!./src/VueDragTree.vue\n// module id = 46\n// module chunks = 0","module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n staticClass: \"dnd-container\",\n style: (_vm.styleObj),\n attrs: {\n \"draggable\": _vm.isDraggable\n },\n on: {\n \"drag\": function($event) {\n $event.stopPropagation();\n return _vm.drag($event)\n },\n \"dragstart\": function($event) {\n $event.stopPropagation();\n return _vm.dragStart($event)\n },\n \"dragover\": function($event) {\n $event.stopPropagation();\n return _vm.dragOver($event)\n },\n \"dragenter\": function($event) {\n $event.stopPropagation();\n return _vm.dragEnter($event)\n },\n \"dragleave\": function($event) {\n $event.stopPropagation();\n return _vm.dragLeave($event)\n },\n \"drop\": function($event) {\n $event.stopPropagation();\n return _vm.drop($event)\n },\n \"dragend\": function($event) {\n $event.stopPropagation();\n return _vm.dragEnd($event)\n }\n }\n }, [_c('div', {\n class: {\n 'is-clicked': _vm.isClicked, 'is-hover': _vm.isHover\n },\n on: {\n \"click\": _vm.toggle,\n \"mouseover\": _vm.mouseOver,\n \"mouseout\": _vm.mouseOut,\n \"dblclick\": _vm.changeType\n }\n }, [_c('div', {\n staticClass: \"treeNodeText\",\n style: ({\n 'padding-left': (this.depth - 1) * 24 + 'px'\n }),\n attrs: {\n \"id\": _vm.model.id\n }\n }, [_vm._t(\"default\", [_c('span', {\n class: [\n _vm.isClicked ? 'nodeClicked' : '',\n _vm.model.children && _vm.model.children.length > 0 ?\n 'vue-drag-node-icon' :\n 'no-vue-drag-node-icon' ]\n }), _vm._v(\" \"), _c('span', {\n staticClass: \"text\"\n }, [_vm._v(_vm._s(_vm.model.name))])], {\n \"nodeName\": _vm.model.name,\n \"isClicked\": _vm.isClicked\n })], 2)]), _vm._v(\" \"), (_vm.isFolder) ? _c('div', {\n directives: [{\n name: \"show\",\n rawName: \"v-show\",\n value: (_vm.open),\n expression: \"open\"\n }],\n staticClass: \"treeMargin\"\n }, _vm._l((_vm.model.children), function(item2) {\n return _c('drag-node', {\n key: item2.id,\n attrs: {\n \"allowDrag\": _vm.allowDrag,\n \"allowDrop\": _vm.allowDrop,\n \"depth\": _vm.increaseDepth,\n \"model\": item2,\n \"defaultText\": _vm.defaultText,\n \"disableDBClick\": _vm.disableDBClick\n }\n })\n }), 1) : _vm._e()])\n},staticRenderFns: []}\nmodule.exports.render._withStripped = true\nif (module.hot) {\n module.hot.accept()\n if (module.hot.data) {\n require(\"vue-hot-reload-api\").rerender(\"data-v-595cdfee\", module.exports)\n }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/template-compiler?{\"id\":\"data-v-595cdfee\",\"hasScoped\":false}!./~/vue-loader/lib/selector.js?type=template&index=0!./src/DragNode.vue\n// module id = 47\n// module chunks = 0"],"sourceRoot":""} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-drag-tree", 3 | "version": "1.1.9", 4 | "description": "Drag and drop tree components for Vue2.x, easy to use", 5 | "author": "shuiRong ", 6 | "private": false, 7 | "main": "dist/vue-drag-tree.min.js", 8 | "scripts": { 9 | "dev": "node build/dev-server.js", 10 | "build": "node build/build.js" 11 | }, 12 | "publishConfig": { "registry": "https://npm.pkg.github.com/@shuirong" }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git+https://github.com/shuiRong/vue-drag-tree.git" 16 | }, 17 | "bugs": { 18 | "url": "https://github.com/shuiRong/vue-drag-tree/issues" 19 | }, 20 | "files": [ 21 | "dist", 22 | "src" 23 | ], 24 | "keywords": [ 25 | "vue-drag-tree", 26 | "vue-drag", 27 | "drag", 28 | "drop", 29 | "tree", 30 | "vue", 31 | "vue-components", 32 | "vuedragtree", 33 | "dragdrop", 34 | "drag and drop", 35 | "draganddrop" 36 | ], 37 | "license": "MIT", 38 | "homepage": "https://github.com/shuiRong/vue-drag-tree#readme", 39 | "dependencies": { 40 | "vue": "^2.6.10" 41 | }, 42 | "devDependencies": { 43 | "autoprefixer": "^6.7.2", 44 | "babel-core": "^6.22.1", 45 | "babel-eslint": "^7.1.1", 46 | "babel-loader": "^6.2.10", 47 | "babel-plugin-transform-runtime": "^6.22.0", 48 | "babel-preset-env": "^1.3.2", 49 | "babel-preset-stage-2": "^6.22.0", 50 | "babel-register": "^6.22.0", 51 | "chalk": "^1.1.3", 52 | "chromedriver": "^2.27.2", 53 | "connect-history-api-fallback": "^1.3.0", 54 | "copy-webpack-plugin": "^4.0.1", 55 | "cross-spawn": "^5.0.1", 56 | "css-loader": "^0.28.0", 57 | "eslint": "^3.19.0", 58 | "eslint-config-standard": "^6.2.1", 59 | "eslint-friendly-formatter": "^2.0.7", 60 | "eslint-loader": "^1.7.1", 61 | "eslint-plugin-html": "^2.0.0", 62 | "eslint-plugin-promise": "^3.4.0", 63 | "eslint-plugin-standard": "^2.0.1", 64 | "eventsource-polyfill": "^0.9.6", 65 | "express": "^4.14.1", 66 | "extract-text-webpack-plugin": "^2.0.0", 67 | "file-loader": "^0.11.1", 68 | "friendly-errors-webpack-plugin": "^1.1.3", 69 | "html-webpack-plugin": "^2.28.0", 70 | "http-proxy-middleware": "^0.17.3", 71 | "nightwatch": "^0.9.12", 72 | "node-sass": "^4.5.3", 73 | "opn": "^4.0.2", 74 | "optimize-css-assets-webpack-plugin": "^1.3.0", 75 | "ora": "^1.2.0", 76 | "rimraf": "^2.6.0", 77 | "sass-loader": "^6.0.6", 78 | "selenium-server": "^3.0.1", 79 | "semver": "^5.3.0", 80 | "shelljs": "^0.7.6", 81 | "url-loader": "^0.5.8", 82 | "vue-loader": "^12.1.0", 83 | "vue-style-loader": "^3.0.1", 84 | "vue-template-compiler": "^2.6.10", 85 | "webpack": "^2.6.1", 86 | "webpack-bundle-analyzer": "^2.2.1", 87 | "webpack-dev-middleware": "^1.10.0", 88 | "webpack-hot-middleware": "^2.18.0", 89 | "webpack-merge": "^4.1.0" 90 | }, 91 | "engines": { 92 | "node": ">= 4.0.0", 93 | "npm": ">= 3.0.0" 94 | }, 95 | "browserslist": [ 96 | "> 1%", 97 | "last 2 versions", 98 | "not ie <= 8" 99 | ] 100 | } 101 | -------------------------------------------------------------------------------- /src/DragNode.vue: -------------------------------------------------------------------------------- 1 | 2 | 14 | 21 | 26 | 27 | 35 | {{ model.name }} 36 | 37 | 38 | 39 | 40 | 50 | 51 | 52 | 53 | 54 | 230 | 231 | 301 | -------------------------------------------------------------------------------- /src/VueDragTree.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 89 | 90 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import VueDragTree from './VueDragTree.vue' 2 | 3 | const VueDragTreeComponent = { 4 | install: function (Vue) { 5 | if (typeof window !== 'undefined' && window.Vue) { 6 | Vue = window.Vue 7 | } 8 | Vue.component('VueDragTree', VueDragTree) 9 | } 10 | } 11 | 12 | export default VueDragTreeComponent 13 | -------------------------------------------------------------------------------- /src/util.js: -------------------------------------------------------------------------------- 1 | // 返回最顶层那个vue-drag-tree.vue组件 2 | const findRoot = (which) => { 3 | let ok = false; 4 | let that = which; 5 | while (!ok) { 6 | // 根据组件name来判断 7 | if (that.$options._componentTag === "vue-drag-tree") { 8 | ok = true; 9 | // 交换两者的数据 10 | break; 11 | } 12 | that = that.$parent; 13 | } 14 | return that; 15 | }; 16 | 17 | /** 18 | * 是否两节点为包含关系 19 | * 即:直系父与子的关系 20 | * P.S. 解决from祖父节点拖到子孙节点时元素消失的bug 21 | * https://github.com/shuiRong/vue-drag-tree/issues/32 22 | */ 23 | const hasInclude = (from, to) => { 24 | while (from.$parent != undefined) { 25 | if (from.$parent._uid === to._uid) { 26 | return true; 27 | } else { 28 | from = from.$parent; 29 | } 30 | } 31 | return false; 32 | }; 33 | 34 | /** 35 | * 两节点为直线关系? 36 | * 即:from为to的某个子集,但又不是父子关系? 37 | */ 38 | const isLinealRelation = (from, to) => { 39 | let parent = from.$parent; 40 | 41 | // 判断完成,不管是什么结果 42 | let ok = false; 43 | // 是直线关系? 44 | let status = false; 45 | while (!ok) { 46 | if (parent._uid === to._uid) { 47 | ok = true; 48 | status = true; 49 | continue; 50 | } 51 | if ( 52 | !parent.$options._componentTag || 53 | parent.$options._componentTag === "vue-drag-tree" 54 | ) { 55 | // 如果检测到这里,就该结束了。 56 | ok = true; 57 | break; 58 | } 59 | parent = parent.$parent; 60 | } 61 | 62 | return status; 63 | }; 64 | 65 | /** 66 | * 交换两节点数据 67 | * @param rootCom 根组件(vue-drag-tree.vue) 68 | * @param from 被拖拽节点组件Vnode数据 69 | * @param to 拖拽节点组件Vnode数据 70 | */ 71 | const exchangeData = (rootCom, from, to) => { 72 | // 如果拖动节点和被拖动节点相同,return; 73 | if (from._uid === to._uid) { 74 | return; 75 | } 76 | 77 | // 如果两者是父子关系且from是父节点,to是子节点,什么都不做 78 | if (hasInclude(to, from)) { 79 | return; 80 | } 81 | 82 | const newFrom = Object.assign({}, from.model); 83 | 84 | // 如果两者是父子关系。将from节点,移动到to节点一级且放到其后一位 85 | if (hasInclude(from, to)) { 86 | // 如果“父”是最上层节点(节点数组中的最外层数据) 87 | const tempParent = to.$parent; 88 | const toModel = to.model; 89 | 90 | if (tempParent.$options._componentTag === "vue-drag-tree") { 91 | // 将from节点添加到 根数组中 92 | tempParent.newData.push(newFrom); 93 | // 移除to中from节点信息; 94 | toModel.children = toModel.children.filter( 95 | (item) => item.id !== newFrom.id 96 | ); 97 | return; 98 | } 99 | 100 | const toParentModel = tempParent.model; 101 | // 先移除to中from节点信息; 102 | toModel.children = toModel.children.filter( 103 | (item) => item.id !== newFrom.id 104 | ); 105 | // 将 from节点 添加到 to 一级别中。 106 | toParentModel.children = toParentModel.children.concat([newFrom]); 107 | return; 108 | } 109 | 110 | // 如果是 线性 关系,但非父子 111 | if (isLinealRelation(from, to)) { 112 | const fromParentModel = from.$parent.model; 113 | const toModel = to.model; 114 | 115 | // 先将from从其父节点信息移除; 116 | fromParentModel.children = fromParentModel.children.filter( 117 | (item) => item.id !== newFrom.id 118 | ); 119 | 120 | // 再from节点添加到to节点中最后一位。 121 | toModel.children = toModel.children.concat([newFrom]); 122 | return; 123 | } 124 | 125 | // 两节点(无线性关系),把from节点扔到to节点中。 126 | const fromParentModel = from.$parent.model; 127 | const toModel = to.model; 128 | // 先将from从其父节点信息移除; 129 | if (from.$parent.$options._componentTag === "vue-drag-tree") { 130 | /** 131 | * 找到vue-drag-tree的父组件(数据源头),在这里修改数据。 132 | */ 133 | from.$parent.newData = from.$parent.newData.filter( 134 | (item) => item.id !== newFrom.id 135 | ); 136 | } else { 137 | fromParentModel.children = fromParentModel.children.filter( 138 | (item) => item.id !== newFrom.id 139 | ); 140 | } 141 | 142 | // 再from节点添加到to节点中最后一位。 143 | if (!toModel.children) { 144 | toModel.children = [newFrom]; 145 | } else { 146 | toModel.children = toModel.children.concat([newFrom]); 147 | } 148 | }; 149 | 150 | export { findRoot, exchangeData }; 151 | -------------------------------------------------------------------------------- /static/preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuiRong/vue-drag-tree/e124512a72da01202de263f8705da7efcccacee1/static/preview.gif --------------------------------------------------------------------------------