ideaz-element
Version:
<p align="center"> <a href="" target="_blank" rel="noopener noreferrer"> <img src="./docs/public/logo.svg" alt="Ideaz Element" width="180" style="width: 180px;" /> </a> </p>
3 lines (2 loc) • 864 B
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue");function u(t,d,a){const s=c.ref(!1);return{draggableOptions:[{selector:"tbody",options:{animation:200,handle:".z-table-column-draggable",ghostClass:"ghost",dragClass:"drag-class",onStart:()=>{s.value=!0},onEnd:n=>{s.value=!1;const{oldIndex:o,newIndex:r}=n,e=[...d.value],l=e[o];e.splice(o,1),e.splice(r,0,l),t("update:data",e),t("drag-sort-end",d.value)}}},{selector:".el-table__header-wrapper tr",options:{animation:150,delay:0,ghostClass:"table-col__ghost",onEnd:n=>{const{newIndex:o,oldIndex:r}=n,e=[...a.value],[l]=[...e.splice(r,1)];e.splice(o,0,l),a.value=[],c.nextTick(()=>{a.value=[...e],t("drag-column-end",a.value.filter(g=>g.prop)[n.newIndex],n.newIndex,n.oldIndex)})}}}],dragging:s}}exports.useDraggable=u;
//# sourceMappingURL=useDraggable.cjs.map