Dayspan Vuetify:在日间单元格中添加一个按钮

时间:2018-11-27 20:30:53

标签: vue.js vuetify.js

我正在基于Dayspan Vuetify库( https://github.com/ClickerMonkey/dayspan-vuetify)。
我不知道如何在每天的单元格中添加按钮。欢迎有人帮助!
Live Demo enter image description here

1 个答案:

答案 0 :(得分:0)

您可以在模板中放置任何内容(请参见按钮):

https://github.com/ClickerMonkey/dayspan-vuetify-example/blob/master/src/App.vue

<template slot="eventTimeTitle" slot-scope="{calendarEvent, details}">
        <div>
          <v-icon class="ds-ev-icon"
            v-if="details.icon"
            size="14"
            :style="{color: details.forecolor}">
            {{ details.icon }}
          </v-icon>
          <v-btn outline @click="doSomething" color="indigo">Button</v-btn>
          <strong class="ds-ev-title">{{ details.title }}</strong>
        </div>
        <div class="ds-ev-description">{{ getCalendarTime( calendarEvent ) }}</div>
      </template>

为点击添加方法:

doSomething(e) {
  console.log(e);
  alert('clicked')
}
相关问题