Simple year and month picker inspired by vuetify's monthpicker.
Vue component compatible with Vue 2.x
To view a demo online: CodeSandBox
To view demo examples locally clone the repo and run npm install && npm run serve
Use npm: npm i v-month-picker --save
// main.js
import MonthPicker from "v-month-picker";
Vue.component('MonthPicker', MonthPicker);
import MonthPicker from 'v-month-picker';
export default {
components: {
MonthPicker
}
// your code...
}
Below code in the <template>
:
<MonthPicker horizontal-align="left" vertical-align="bottom" locale="en" v-model="date"/>
Prop | Type | Default | Description |
---|---|---|---|
v-model (required) | String |
Date in ISO format | |
horizontal-align | String |
bottom | Horizontal positioning of the popup |
vertical-align | String |
center | Vertical positioning of the popup |
locale | String |
ru | Translation for months |
first-year | String |
1950 | Start year |
last-year | String |
2049 | End year |
MIT
This is my first npm package, please don't hit me ;)