-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.js
25 lines (24 loc) · 834 Bytes
/
main.js
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
import Vue from "vue";
import V_Pikaday from "./directives/pikaday";
const App = new Vue({
el: "#app",
data: {
startDate: "",
endDate: "",
endDatePikadayOptions: {
format: "D/M/YYYY",
// you can put more pikaday options here based on your needs
// however `field` and `onSelect` option will be ignored
// because they are being used by v-pikaday directive to initialize a Pikaday instance
},
},
directives: {
pikaday: V_Pikaday,
},
mounted: function () {
const startDateElement = document.querySelector("#this-is-start-date");
console.log(startDateElement.pikadayInstance);
// you can access a Pikaday instance at the `mounted` stage of the parent VM,
// by accessing the `pikadayInstance` property of the element that v-pikaday directive is bind with
},
});