UNPKG

xdesign-vue-next

Version:

XDesign Component for vue-next

31 lines (23 loc) 923 B
/** * xdesign v1.0.6 * (c) 2023 xdesign * @license MIT */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray); function swapDragArrayElement(data, currentIndex, targetIndex) { var newData = _toConsumableArray__default["default"](data); if (targetIndex - currentIndex > 0) { newData.splice(targetIndex + 1, 0, newData[currentIndex]); newData.splice(currentIndex, 1); } else { newData.splice(targetIndex, 0, newData[currentIndex]); newData.splice(currentIndex + 1, 1); } return newData; } exports["default"] = swapDragArrayElement; //# sourceMappingURL=swapDragArrayElement.js.map