欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

详解vue移动端日期选择组件

程序员文章站 2022-05-14 14:14:20
先给大家分享一下源码: build setup # install dependencies npm install # build for pro...

先给大家分享一下源码:

详解vue移动端日期选择组件

build setup

# install dependencies
npm install

# build for production with minification
npm run build

usage

install

npm install vue-mobile-calendar

or:(from the dist folder)

<script src="vue-mobile-calendar.js" type="text/javascript"></script>

quickstart

import vue from 'vue'
import calendar from 'vue-mobile-calendar'

vue.use(calendar)
<calendar
 v-model="calendarshow"
 :defaultdate="defaultdate"
 @change="handelchange">
</calendar>

attributes

option description type default
v-model show/hide the calendar boolean false
format format date string "yyyy-mm-dd"
defaultdate default selected date date new date()
mindate optional minimum date date null
maxdate optional maximum date date null
closebyclickmask close by mask boolean true
month text of month array ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"]
week text of day array ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]

events

event name description parameter of callback
change when date change (date,formatdate)

reference

framework7

mint-ui