1.0.92 • Published 3 years ago

vue-quick-calendar v1.0.92

Weekly downloads
14
License
MIT
Repository
-
Last release
3 years ago

vue-quick-calendar

轻量级的Vue日历组件,兼容PC端和移动端,组件功能介绍在这里:vue-quick-calendar

一、安装方法:

1. npm安装

npm install vue-quick-calendar

2.yarn安装

yarn add vue-quick-calendar

二、引入方法:

1. 全局引入

// main.js中
import VueQuickCalendar from 'vue-quick-calendar'
Vue.use(VueQuickCalendar)

2. 组件内部引入

<script>
  import vueQuickCalendar from 'vue-quick-calendar'
  export default {
    components: {
      vueQuickCalendar
    }
  }
</script>

三、使用方法

<template>
  <vue-quick-calendar
    showPrepNext
    startYearMonth='2021-01'
    :markDate="markDate"
    :checkedDate='checkedDate'
    @clickDate="clickDate"
    @changeMonth="changeMonth"
  />
</template>

<script>
// 若全局引入,此处不需要再引入
import vueQuickCalendar from 'vue-quick-calendar'
export default {
  components: {
    // 若全局引入,此处不需要再引入
    vueQuickCalendar
  },
  data () {
    return {
      markDate: ['2021/1/1', '2021-01-12', '2021-1-18', '2021-01-20'],
      // date: '2021-01-20'
      checkedDate: '2021/01/20'
    }
  },
  created () {
  },
  methods: {
    // 点击日期
    clickDate (date) {
      console.log(date)
    },
    // 切换月份
    changeMonth (date) {
      console.log(date)
    }
  }
}
</script>

<style lang='scss' scoped>
</style>

四、Calendar Attributes

参数说明类型可选值默认值举例
startYearMonth初始年月String今年本月'2020-01'、'2020/1'
markDate需要标记的日期数组Array'2020-01-01', '2020/1/2'
checkedDate选中的日期String'2020-01-01'、'2020/1/1'
mondayStart是否从周一开始,默认周日开始Booleantrue/falsefalse
showPrepNext是否显示上个月和下个月日期Booleantrue/falsetrue
foldDateSwitch控制是否折叠【非今天日期】或者【非选中日期】所在的行Booleantrue/falsefalse
weekColor星期字体颜色Stringhsl / hsv / hex / rgb#444
fontColor日期字体颜色Stringhsl / hsv / hex / rgb#000
markColor标记点颜色Stringhsl / hsv / hex / rgb#ff6633
activeColor选中的日期字体颜色Stringhsl / hsv / hex / rgb#fff
activeBgColor选中的日期背景颜色Stringhsl / hsv / hex / rgb#ff6633

五、Calendar Events

事件名说明参数
clickDate点击日期date, item
changeMonth切换月份date

长期维护中…

1.0.92

3 years ago

1.0.91

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago