A Support Drag and Drop Scheduler on vue.js

A Support Drag and Drop Scheduler on vue.js

A dynamic, resizable, draggable, and touch-enabled scheduler component for Vue.js applications.

Description:

A dynamic, resizable, draggable, and touch-enabled scheduler component for Vue.js applications.

Install & Download:

# NPM
$ npm install vue-scheduler-lite --save

How to use it:

  1. Import the component.
import schedulerLite from "./components/schedulerLite";
  1. Create a scheduler on the app.
<sc :schedule-data="scData"
  :setting="setting"
  @row-click-event="rowClickEvent"
  @date-click-event="dateClickEvent"
  @click-event="clickEvent"
  @add-event="addEvent"
  @move-event="moveEvent"
  @edit-event="editEvent"
  @delete-event="deleteEvent"
></sc>
export default {
  name: "App",
  components: {
    sc: schedulerLite
  },
  data: function() {
    return {
      scData: sampleData,
      setting: sampleSetting
    };
  },
  methods: {
    dateClickEvent(date) {
      console.log("------");
      console.log("DateClickEvent:");
      console.log("Date:" + date);
    },
    rowClickEvent(rowIndex, text) {
      console.log("------");
      console.log("RowClickEvent:");
      console.log("RowIndex:" + rowIndex);
      console.log("RowTitle:" + text);
    },
    clickEvent(startDate, endDate, text, other) {
      console.log("------");
      console.log("ClickEvent:");
      console.log("StartDate:" + startDate);
      console.log("EndDate:" + endDate);
      console.log("ContentText:" + text);
      if (other) {
        console.log("OtherData:");
        console.log(other);
      }
    },
    addEvent(rowIndex, startDate, endDate) {
      console.log("------");
      console.log("AddEvent:");
      console.log("RowIndex:" + rowIndex);
      console.log("StartDate:" + startDate);
      console.log("EndDate:" + endDate);
    },
    moveEvent(status, newStartDate, newEndDate) {
      console.log("------");
      console.log("MoveEvent:");
      if (status == 1) {
        console.log("NewStartDate:" + newStartDate);
        console.log("NewEndDate:" + newEndDate);
      } else {
        console.log("Not businessDay, can't move.");
      }
    },
    editEvent(newStartDate, newEndDate) {
      console.log("------");
      console.log("EditEvent:");
      console.log("NewStartDate:" + newStartDate);
      console.log("NewEndDate:" + newEndDate);
    },
    deleteEvent(row, index) {
      console.log("------");
      console.log("DeleteEvent:");
      console.log("Row:" + row);
      console.log("Index:" + index);
    },
    addNewRow() {
      let newTitle = "Room" + (this.scData.length + 1);
      this.scData.push({
        title: newTitle,
        noBusinessDate: [],
        businessHours: [
          {
            start: "00:00",
            end: "24:00"
          },
          {
            start: "00:00",
            end: "24:00"
          },
          {
            start: "00:00",
            end: "24:00"
          },
          {
            start: "00:00",
            end: "24:00"
          },
          {
            start: "00:00",
            end: "24:00"
          },
          {
            start: "00:00",
            end: "24:00"
          },
          {
            start: "00:00",
            end: "24:00"
          }
        ],
        schedule: []
      });
    }
  }
};
  1. Define your own data (scheduled tasks).
const sampleData = [
  {
    title: "Room1",
    noBusinessDate: ["2020/04/20"],
    businessHours: [
      {
        start: "00:00",
        end: "24:00"
      },
      {
        start: "00:00",
        end: "24:00"
      },
      {
        start: "00:00",
        end: "24:00"
      },
      {
        start: "00:00",
        end: "24:00"
      },
      {
        start: "00:00",
        end: "24:00"
      },
      {
        start: "00:00",
        end: "24:00"
      },
      {
        start: "00:00",
        end: "24:00"
      }
    ],
    schedule: [
      {
        text: "Mr.A reserved",
        start: "2020/04/21 06:00",
        end: "2020/04/22 01:00",
        data: {
          something: "something"
        }
      },
      {
        text: "Mr.B reserved",
        start: "2020/04/22 06:00",
        end: "2020/04/22 12:00",
        data: {
          something: "something"
        }
      }
    ]
  },
  {
    title: "Room2",
    noBusinessDate: [],
    businessHours: [
      {
        start: "10:00",
        end: "17:00"
      },
      {
        start: "10:00",
        end: "17:00"
      },
      {
        start: "10:00",
        end: "17:00"
      },
      {
        start: "10:00",
        end: "17:00"
      },
      {
        start: "10:00",
        end: "17:00"
      },
      {
        start: "10:00",
        end: "17:00"
      },
      {
        start: "10:00",
        end: "17:00"
      }
    ],
    schedule: [
      {
        text: "Mr.C reserved",
        start: "2020/04/20 12:00",
        end: "2020/04/20 17:00",
        data: {
          something: "something"
        }
      }
    ]
  },
  {
    title: "Room3",
    noBusinessDate: [],
    businessHours: [
      {
        start: "00:00",
        end: "24:00"
      },
      {
        start: "00:00",
        end: "24:00"
      },
      {
        start: "00:00",
        end: "24:00"
      },
      {
        start: "00:00",
        end: "24:00"
      },
      {
        start: "00:00",
        end: "24:00"
      },
      {
        start: "00:00",
        end: "24:00"
      },
      {
        start: "00:00",
        end: "24:00"
      }
    ],
    schedule: [
      {
        text: "Mr.D reserved",
        start: "2020/04/20 12:00",
        end: "2020/04/20 18:00",
        data: {
          something: "something"
        }
      }
    ]
  }
];
const sampleSetting = {
  startDate: "2020/04/20",
  endDate: "2020/04/26",
  weekdayText: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  unit: 60, // Minutes
  borderW: 1, // Px
  dateDivH: 25, // Px
  timeDivH: 25, // Px
  unitDivW: 25, // Px
  titleDivW: 20, // Percent
  rowH: 135 // Px
};

Download Details:

Author: linmasahiro

Live Demo: https://linmasahiro.github.io/vue-scheduler-lite/dist/

Download Link: https://github.com/linmasahiro/vue-scheduler-lite/archive/master.zip

Official Website: https://github.com/linmasahiro/vue-scheduler-lite

vuejs javascript vue vue-js

What's new in Bootstrap 5 and when Bootstrap 5 release date?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Random Password Generator Online

HTML Color Picker online | HEX Color Picker | RGB Color Picker

How to build Vue.js JWT Authentication with Vuex and Vue Router

In this tutorial, we’re gonna build a Vue.js with Vuex and Vue Router Application that supports JWT Authentication

Performance Boost Using Highcharts.js and Vue.js

How to Maintain Performance with Big Datasets Using Highcharts. js and Vue. Sometimes you just need to show big datasets in your project. However, the library that you've used so far, as soon as you start to add data, becomes clunky and slow.

A Vue.js 2.0 Slideshow Component Working with Three.js

vue-displacement-slideshow .Webgl image displacement transitions made simple. A Vue.js 2.0 slideshow component working with Three.js and GSAP.

Vue.js Tab Components Based on Vue Router

vue-router-tab .A tab router component based on Vue Router.

Vue Dashboard Tutorial Using Cube.js

There are a couple of popular front-end frameworks today. We recently covered how to build an analytics dashboard with React and Angular.