Skip to content

Using with vuejs datepicker

Edgard Rosberg Duarte Leal edited this page Sep 14, 2018 · 2 revisions

See this code runing on CodePen

requirejs.config({
    waitSeconds: 1,
    paths: {
        "Vue": "https://cdnjs.cloudflare.com/ajax/libs/vue/2.3.4/vue",
        "vue": ["require-vuejs", "https://rawgit.com/edgardleal/require-vuejs/master/dist/require-vuejs"],
        "vuejs-datepicker": "https://cdn.jsdelivr.net/npm/vuejs-datepicker@1.5.3/dist/vuejs-datepicker.min"
    },
    shim: {
        "Vue": {"exports": "Vue"}
    }
});

require([
   "Vue", 
   "vuejs-datepicker"
   ], function(Vue, VuejsDatePicker){

    Vue.component('vuejs-datepicker', VuejsDatePicker);
    Vue.component('my-component', {
       template: '<vuejs-datepicker></vuejs-datepicker>'
    });
    new Vue({
        el: "#app"        
    });
});
Clone this wiki locally