Blame view

src/pages/Calendar.vue 1.17 KB
93a68cfa1   Jatinder Singh   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
  <template>
    <v-container fluid>
      <v-layout column>
        <v-flex>
          <full-calendar class="fullwidth" :events="fcEvents" @dayClick="handleDayClick" @eventClick="handleEventClick">
          </full-calendar>
        </v-flex>
      </v-layout>
        <v-dialog v-model="dialog" width="650">
          <event-form ref="eForm" v-bind="dialogData"></event-form>
        </v-dialog>  
    </v-container>
  </template>
  
  <script>
  import FullCalendar from 'vue-fullcalendar';
  import EventForm from '../components/widgets/form/EventForm';
  
  export default {
    components: {
      FullCalendar,
      EventForm
    },
    data: () => ({
      size: 'sm',
      dialog: false,
      dialogData: null,
      fcEvents: [
        {
          title: 'Sunny Out of Office',
          start: '2018-03-30',
          end: '2018-04-02'  
        }
      
      ],
  
    }),
  
  
    
    methods: {
      handleDayClick (day, e) {
        this.dialog = true;
      },
      handleEventClick (e, event, pos) {
        this.dialog = true;
        this.$refs.eForm.title = e.title;
        this.$refs.eForm.startDate = e.start;
        this.$refs.eForm.endDate = e.end;
  
      }
    },
  };
  </script>
  <style scoped>
  .fullwidth {
    width: 100%!important;
    max-width: 100%;;
  }
  </style>