Skip to content

A date picker component for Vue.js (v2.x.x) apps. Built on top of Pikaday. (Not finished yet)

Notifications You must be signed in to change notification settings

qyt2018/vue-pikaday

 
 

Repository files navigation

Vue-Pikaday

A custom directive for using Pikaday in Vue.js apps.

banner

Demo

Usage

  1. Download this repo and copy file directives/pikaday.js into your project.

  2. Register Vue-Pikaday as a directive in your main.js:

     // main.js
     Vue.directive('pikaday', require('./directives/pikaday'));
    
  3. Vue-Pikaday need an <input> element to display time. Add v-pikaday directive to this <input> and assign a string value to it.

     // template.html
     <input type="text" v-pikaday="defaultDate">
     
     // index.js
     module.exports = {
         template: require('./template.html'),
         data: function () {
             return {
                 defaultDate: ''
             };
         }
     }
    
  4. If you want a different format of time, there's a format option to do this.

     // template.html
     <input type="text" v-pikaday="defaultDate" format="MMMM Do, YYYY">        
    

License

MIT

About

A date picker component for Vue.js (v2.x.x) apps. Built on top of Pikaday. (Not finished yet)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 62.5%
  • HTML 36.0%
  • CSS 1.5%