如何撤消在Vue上进行的拖放

时间:2019-02-12 08:12:59

标签: vue.js

我已经请忙碌的人拖拉我。似乎工作正常,但是他们没有答复,我想单击一个撤消按钮,所以这是放置操作发生的最后一个功能。我想把它推回原处。你能帮我吗

这是我的拖放代码

handleDropBookingIntoCell: function (el) {
      if (this.isEmptySlots(el)) {
        let data = {...el.data}
        console.log(data);
        this.focus.booking = data.cursor.id;
        this.focus.slot = data.dropzone.id;
        $('div.booking.booking-movable[data-id="'+data.cursor.id+'"]').each((index, element) => {
          let dropTD = 'td.week-day-'+data.dropzone.column+(data.dropzone.index + index);
          let dragTD = 'td.week-day-'+data.dragzone.column+(data.dragzone.index + index);
          $(dragTD).removeClass('u-bg-danger').addClass('u-bg-primary');
          $(element).appendTo(dropTD);
          $(dropTD).removeClass('u-bg-primary').addClass('u-bg-danger');
        });
        this.dataOutput = {
          bookingID: data.cursor.id,
          slotID: data.dropzone.id,
          totalSlots: data.cursor.total
        };

        this.updateSlot();

        this.bookingDroppedMSG = "Booking slot has been successfully changed."; 
      }
  },

是在Vue上制作的

0 个答案:

没有答案