如何调换Vue V-Calendar的员工轴与时间轴布局?
解决方案
要实现员工轴与时间轴的位置调换,只需在你的v-calendar组件中添加orientation="horizontal"属性即可,这会将分类(员工)轴切换到顶部,时间轴切换到左侧,匹配你要的预期效果。
修改后的代码示例:
<v-calendar category-show-all ref="calendar" event-overlap-mode="stack" v-model="filter.date" type="category" orientation="horizontal" <!-- 核心修改 --> :categories="category.list" :events="category.events" :event-color="getEventColor" :now="minimumDate" @change="getEvents" :row-height="60" :interval-height="20" @click:event="showEvent"> </v-calendar>
如果需要进一步微调布局细节,可以搭配以下属性:
time-width:设置左侧时间轴的宽度category-width:设置顶部分类轴的单栏宽度time-format/interval-format:调整时间轴的显示格式
内容的提问来源于stack exchange,提问作者Deepak Kumar
相关产品推荐
相关产品推荐

