0.0.7 • Published 4 years ago
ms-calendar v0.0.7
ms-calendar
A Vue.js project
Build Setup
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
For detailed explanation on how things work, consult the docs for vue-loader.
Installation
npm install ms-calendar
Use
<template>
<div id="app">
<div class="example">
<button @click="showPicker=true">点击弹出</button>
</div>
<ms-calendar ref="mscalendar" :show-picker='showPicker' :server-date='serverDate' show-month-tab='false' monthsRange='3' active='0' within-month='true' theme-color='deeppink' @confirm='confirm' @close='showPicker=false'></ms-calendar>
</div>
</template>
import msCalendar from 'ms-calendar';
Vue.use(msCalendar);
components: {
msCalendar
}
data () {
return {
showPicker: false,
serverDate: ''
}
},
created(){
// 设定服务器时间
this.serverDate = '2021/2/8'
},
methods: {
confirm(dates){
console.log("selected", dates)
},
}
Props
prop | descripton | type | default |
---|---|---|---|
showPicker | 显示日历 | Boolean | false |
themeColor | 主题颜色 | String | "#e60027" |
showMonthTab | 显示按月选择 | String | "true" |
showDayTab | 显示按日选择 | String | "true" |
serverDate | 设定当前时间 | String | "2021/5/1" |
monthsRange | 日历范围 | String | "6" |
withinMonth | 是否可以跨月选择 | String | "false" |
Events
event | descripton |
---|---|
confirm | 选择日期事件 |
close | 关闭日历事件 |