Schedule error on independent component

Hi,

I'm trying to use vue3 your boilerplate for schedule https://github.com/SyncfusionExamples/vue3-schedule-getting-started.

It works great with default values but, when I move the schedule to another component it doesn't work.

File: App.vue

<template>
  <div id="app">
    <Planner />
  </div>
</template>
<script>
import { defineComponent } from "vue";
import Planner from "@/components/Planner.vue";

export default defineComponent({
  name: "Home",
  components: {
    Planner
  }
});
</script>


File: components/Planner.vue

<template>
  <ejs-schedule
    height="550px"
    width="100%"
    :selectedDate="selectedDate"
    :eventSettings="eventSettings"
  >
    <e-views>
      <e-view option="Day"></e-view>
      <e-view option="Week" startHour="07:00" endHour="15:00"></e-view>
      <e-view option="WorkWeek" startHour="10:00" endHour="18:00"></e-view>
      <e-view option="Month" showWeekend="false"></e-view>
      <e-view option="Agenda"></e-view>
    </e-views>
    <e-resources>
      <e-resource
        field="OwnerId"
        title="Owner"
        name="Owners"
        :dataSource="ownerDataSource"
        textField="OwnerText"
        idField="Id"
        colorField="OwnerColor"
      >
      </e-resource>
    </e-resources>
  </ejs-schedule>
</template>

<script>
import {
  ScheduleComponent,
  Day,
  Week,
  WorkWeek,
  Month,
  Agenda,
  DragAndDrop,
  Resize,
  ViewsDirective,
  ViewDirective,
  ResourcesDirective,
  ResourceDirective
from "@syncfusion/ej2-vue-schedule";
import "../../node_modules/@syncfusion/ej2-base/styles/material.css";
import "../../node_modules/@syncfusion/ej2-buttons/styles/material.css";
import "../../node_modules/@syncfusion/ej2-calendars/styles/material.css";
import "../../node_modules/@syncfusion/ej2-dropdowns/styles/material.css";
import "../../node_modules/@syncfusion/ej2-inputs/styles/material.css";
import "../../node_modules/@syncfusion/ej2-navigations/styles/material.css";
import "../../node_modules/@syncfusion/ej2-popups/styles/material.css";
import "../../node_modules/@syncfusion/ej2-vue-schedule/styles/material.css";

export default {
  name: "App",
  // Declaring component and its directives
  components: {
    "ejs-schedule": ScheduleComponent,
    "e-views": ViewsDirective,
    "e-view": ViewDirective,
    "e-resources": ResourcesDirective,
    "e-resource": ResourceDirective
  },
  // Bound properties declaration
  data() {
    return {
      selectedDate: new Date(2021712),
      allowMultiple: true,
      ownerDataSource: [
        { OwnerText: "Nancy"Id: 1OwnerColor: "#ffaa00" },
        { OwnerText: "Steven"Id: 2OwnerColor: "#f8a398" },
        { OwnerText: "Michael"Id: 3OwnerColor: "#7499e1" }
      ],
      eventSettings: {
        dataSource: [
          {
            Id: 1,
            Subject: "Surgery - Andrew",
            EventType: "Confirmed",
            StartTime: new Date(202171090),
            EndTime: new Date(2021710100),
            OwnerId: 2
          },
          {
            Id: 2,
            Subject: "Consulting - John",
            EventType: "Confirmed",
            StartTime: new Date(2021711100),
            EndTime: new Date(20217111130),
            OwnerId: 3
          },
          {
            Id: 3,
            Subject: "Therapy - Robert",
            EventType: "Requested",
            StartTime: new Date(20217121130),
            EndTime: new Date(20217121230),
            OwnerId: 1
          }
        ]
      }
    };
  },
  provide: {
    schedule: [DayWeekWorkWeekMonthAgendaDragAndDropResize]
  }
};
</script>

<style></style>


I added two screenshots of current issue:

This image shows the initial schedule state.

initial_data.png

This another image shows error when button on schedule are clicked.

errors_thrown.png

How can I solve this issue?

Best regards

Antonio.


3 Replies

SK Satheesh Kumar Balasubramanian Syncfusion Team September 29, 2021 10:19 AM UTC

Hi Alberto, 
  
Thanks for using Syncfusion Products. 
  
We have validated your reported query "Schedule error on independent component" and suggest you to inject the view modules in App.vue page to resolve the reported issue. For the same we have prepared the sample which can be downloaded from the following link. 
  
  
App.vue:    
<template> 
  <div id="app"> 
    <Planner /> 
  </div> 
</template> 
  
<script> 
import Planner from './components/Planner.vue'; 
import { Day, Week, WorkWeek, Month, Agenda, DragAndDrop, Resize } from "@syncfusion/ej2-vue-schedule"; 
  
export default { 
  name: 'App', 
  components: { 
    Planner 
  }, 
  provide: { 
    schedule: [Day, Week, WorkWeek, Month, Agenda, DragAndDrop, Resize] 
  } 
} 
</script> 
  
Kindly try the above sample and let us know if this meets your requirement. 
  
Regards, 
Satheesh Kumar B 



AP Alberto Provencio October 6, 2021 10:36 AM UTC

Thank you very much it works great.



NR Nevitha Ravi Syncfusion Team October 8, 2021 04:11 AM UTC

Hi Alberto, 

You are most welcome..! we are glad that our solution worked at your end. Please get back to us if you need any further assistance. 

Regards, 
Nevitha. 


Loader.
Up arrow icon