Socket
Book a DemoInstallSign in
Socket

vue-fullcalendar-zcj

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-fullcalendar-zcj

vue日历工作日、休息日选择

1.1.6
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

##vue-fullcalendar-zcj

vue-fullcalendar 的基础上修改的满足自己需求的日历插件。

引入

import FullCalendar from 'vue-fullcalendar-zcj'
Vue.component('full-calendar', FullCalendar)

使用

  <full-calendar
    :arrData="fcArrData"
    @dayClick="dayClick"
    @pullData="pullData"
    @resetData="resetData"
    @saveData="saveData">
  </full-calendar>
let demoArrData = [{
	time: '2019-05-05',
	type: 2 // 1:工作日,2:休息日
}]

export default {
	data () {
		return {
      fcArrData: []
    }
  },
  created () {
    this.resetData()
  },
  methods : {
    // 拉取数据 由前端请求公共接口获取数据
    pullData() {
      this.fcArrData =  [...demoArrData]
    },
    // 重置数据
    resetData() {
      this.fcArrData =  [...demoArrData]
    },
    // 保存数据
    saveData() {
      // 保存 数据 然后重置数据
      this.resetData()
		},
		// 点击日期 设置工作日、非工作日
    dayClick (day, jsEvent, dayObj) {
      let arr = []
      for (let item of this.fcArrData) {
        arr.push(item.time)
        if (dayObj.datetime == item.time) {
          item.type = item.type == 1 ? 2 : 1
        }
      }
      if (arr.indexOf(dayObj.datetime) < 0) {
        this.fcArrData.push({
          time: dayObj.datetime,
          type: 2
        })
      }
    }
  }
}

Keywords

vue

FAQs

Package last updated on 27 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.