Two way binding in Vue Daterangepicker component

28 Feb 20231 minute to read

Two-way binding can be achieved by using the v-model directive in Vue. In the following sample, when you change the value in oneDateRangePicker component, v-model will automatically update the value in the other DateRangePicker.

The following example demonstrates how to set the two-way-binding in the DateRangePicker.

<div id="app">
    <div id="wrapper1">
        <ejs-daterangepicker id="daterangepicker" :placeholder="waterMark" v-model="date"></ejs-daterangepicker>
    <div id="wrapper2">
        <ejs-daterangepicker id="daterangepicker1" :placeholder="waterMark" v-model="date"></ejs-daterangepicker>
import Vue from "vue";
import { DateRangePickerPlugin } from "@syncfusion/ej2-vue-calendars";

export default {
  data: function() {
    return {
        waterMark: "Select a Range",
        date: null
  @import "../node_modules/@syncfusion/ej2-base/styles/material.css";
  @import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";
  @import "../node_modules/@syncfusion/ej2-vue-calendars/styles/material.css";
    min-width: 250px;
    float: left;
    margin-left: 100px;
   min-width: 250px;
    float: right;
     margin-right: 100px;