Element Plus日历组件怎么自定义日期单元格内容?

金壵(打工版) 阅读 3

我在用Element Plus的Calendar组件,想在每个日期格子里显示自定义内容,比如当天的待办数量。官方文档说可以用scoped slot,但我试了date-cell好像没生效?

我这样写的:

<el-calendar>
  <template #date-cell="{ date }">
    <div>{{ date.getDate() }}</div>
    <div>3</div>
  </template>
</el-calendar>

结果整个日历直接空白了,控制台也没报错,是不是slot名字写错了?还是得配合其他属性用?

我来解答 赞 0 收藏
二维码
手机扫码查看
暂无解答

暂无解答