GeoffZhu / vue-event-calendar

A simple events calendar for Vue2, no dependencies except Vue2.
http://geoffzhu.cn/vue-event-calendar/
635 stars 228 forks source link

Possibility to add a custom classes to an .item.event based on its events #38

Closed peluprvi closed 7 years ago

peluprvi commented 7 years ago

Bug, feature request, or proposal:

Possibility to add a custom classes to an .item.event based on its events

What is the use-case or motivation for changing an existing behavior?

Days with different style based on the types of events on that day.

Proposed solution

Each event can have a custom class name that will be used on the element .item.event. If a single day have multiple events with multiple custom classes, all custom classes need to be applied on .item.event. This will allow custom styles on event days.

<template>
  <vue-event-calendar :events="demoEvents"></vue-event-calendar>
</template>

<script>
export default {
  data () {
    return {
      demoEvents: [{
        date: '2016/12/15',
        title: 'Dinner',
        desc: 'Dinner with friends',
        classes: 'night other-custom-class no-limit-of-classes'
      },{
        date: '2016/11/12',
        title: 'Bar'
      }]
    }
  }
}
</script>
JingzaisWenzai commented 7 years ago

我下载后引用了,但是提示不能读取属性spilt,找了半天没找到原因,求解答

GeoffZhu commented 7 years ago

@zjwWhisher 请另开个issue, 最好给具体的demo

zabaat commented 7 years ago

@peluprvi I have made PR to resolve this issue https://github.com/GeoffZhu/vue-event-calendar/pull/64