-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue-test.vue
152 lines (138 loc) · 4.83 KB
/
vue-test.vue
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<template>
<div id="app">
<vuecalendar
@dateChanged="date_changed"
>
</vuecalendar>
<br />
<button @click="toggleLoader">Toggle Loader</button>
<button @click="clearSelection">Clear Selection</button>
<button @click="set_month">Set 1st month</button>
<button @click="toggleOtherMonths">Show/Hide Other Month Days</button>
<button @click="loadData">Load Data</button>
<button @click="toggleNavMonths">Toggle Nav Months</button>
<button @click="toggleNavYears">Toggle Nav Years</button>
<br />
<button @click="update_view">Update View</button>
<textarea :value="event_log" style="width:50%;min-width:200px;height:300px;"></textarea>
</div>
</template>
<script>
import vuecalendar from './vue-airbnb-admin-calendar';
//import vuecalendar from './dist/vue-airbnb-admin-calendar.umd.js';
//import vuecalendarcss from './dist/vue-airbnb-admin-calendar.css';
export default{
components:{
vuecalendar
},
data:function(){
return {
event_log:'',
calendar:{
month: 10,
year: 2020,
loading:false,
showOtherMonthDays:true,
todayNameNumberBackgroundColor:'#888',
otherMonthDayBackgroundColor:'#efefef',
otherMonthDayColor:'#000',
navMonthVisible:true,
navYearVisible:true,
dayShortNames:[
'Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'
],
monthNames:[
'Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μαϊος','Ιούνιος','Ιούλιος','Άυγουστος','Σεπτέμβριος',
'Οκτώβριος','Νοέμβριος','Δεκέμβριος'
]
},
data:[
]
};
},
methods:{
update_view:function(){
this.$refs['calendarObj'].update_view();
},
set_month:function(){
this.$refs['calendarObj'].set_month(0);
},
previous_month:function(params){
//delete params['instance'];
this.event_log += 'previous month clicked'+JSON.stringify(params)+'\n';
},
previous_year:function(params){
//delete params['instance'];
this.event_log += 'previous year clicked'+JSON.stringify(params)+'\n';
},
next_year:function(params){
//delete params['instance'];
this.event_log += 'next year clicked'+JSON.stringify(params)+'\n';
},
next_month:function(params){
//delete params['instance'];
this.event_log += 'next month clicked'+JSON.stringify(params)+'\n';
},
day_clicked:function(params){
//delete params['instance'];
this.event_log += 'day clicked:'+JSON.stringify(params)+'\n';
},
range_selected:function(params){
// delete params['instance'];
this.event_log += 'range selected:'+JSON.stringify(params)+'\n';
},
date_changed:function(params){
//console.log(JSON.stringify(params));
this.event_log += 'date changed'+JSON.stringify(params)+'\n';
},
loader_started:function(){
this.event_log += 'loader started\n'
},
loader_ended:function(){
this.event_log += 'loader ended\n'
},
month_changed:function(params){
this.event_log += 'month changed:'+params.month+'\n'
},
year_changed:function(params){
this.event_log += 'year changed:'+params.year+'\n';
},
selection_reset:function(params){
this.event_log += 'selection reset'+JSON.stringify(params)+'\n';
},
renderDateData:function(day){
//console.log(day);
return '['+day+']';
},
toggleLoader:function(){
this.calendar.loading = !this.calendar.loading;
},
clearSelection:function(){
this.$refs['calendarObj'].clearSelection()
},
toggleOtherMonths:function(){
this.calendar.showOtherMonthDays = !this.calendar.showOtherMonthDays;
},
toggleNavYears:function(){
this.calendar.navYearVisible = !this.calendar.navYearVisible;
},
toggleNavMonths:function(){
this.calendar.navMonthVisible = !this.calendar.navMonthVisible;
},
loadData:function(){
alert('false')
}
}
}
</script>
<style scoped>
body{
margin:0;
padding:0;
}
</style>