Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use mpvue calendar

Shulou Source: shulou.com Published: 2022-06-01 07:02:18 10月02日 Update

This article introduces the relevant knowledge of "how to use mpvue calendar". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

WeChat Mini Programs Calendar component based on vue-calendar adapting to mpvue platform

Installation

Npm i mpvue-calendar

Use

Import Calendar from 'mpvue-calendar' bring in components

Register component Calendar in components

Using components in template

Parameters and methods

The value parameter value is an one-dimensional array in normal mode, for example, June 21, 2018 is [2018 value 21]. In range and multi mode, value is a two-dimensional array. For example, range mode selects June 21 to June 28, 2018 as [2018 June 21], [2018 6jue 28].

The events parameter events is a custom comment, for example, on June 21, 2018, it is {'2018-6-21': 'remarks today', '2018-6-22' 'tomorrow's remarks'}, which is dotted in clean mode, but not displayed in lunar lunar calendar mode.

Parameter disabled of disabled is disabled date, for example, 2018-6-21 is ['2018-6-21']

Example

Return to today's import Calendar from 'mpvue-calendar'export default {data () {return {months: [' January', 'February',' March', 'April',' May', 'June',' July', 'August',' September', 'October',' November', 'December'], disabledarr: [' 2018-6-27], value: [2018-6-27] Begin: [2018 Calendar 1], end: [20120 console.log 1], events: {'2016-6-7' remarks for Today', '2018-6-8' notes for tomorrow'},}}, components: {Calendar}, methods: {selectMonth (month,year) {console.log (year,month)}, prev (month) {console.log (month)} Next (month) {console.log (month)}, selectYear (year) {console.log (year)}, setToday (val,val1,val2) {this.$refs.calendar.setToday () }, select (val, val2) {console.log (val) console.log (val2)}} "how to use mpvue calendar" content is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Remarks patterns parameters components content arrays more knowledge practical ordinary successful learning next lunar calendar dilemma dots reality platform situation articles methods Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Xiaomi Apple OPPO Reno Shulou Tech Info