【问题标题】:Using React Big Calendar how can i change the color of the cell that i am pointing使用 React Big Calendar 如何更改我指向的单元格的颜色
【发布时间】:2021-01-30 16:41:04
【问题描述】:

我想改变所有这些颜色。

如果你给我一个示例代码会很有帮助。

非常感谢。

【问题讨论】:

    标签: javascript reactjs react-big-calendar


    【解决方案1】:

    @heukma 很难准确理解您要完成的工作,但在我看来,您正在寻找的是 slotPropGetter 道具。这将允许您根据传入的日期为插槽提供自定义类或样式。

    // your arrow function can contain custom logic, as long
    // as it returns an object with either the `className` or
    // `style` keys (or both). `className` must be a string, while `style`
    // must be an object.
    slotPropGetter={(date) => ({
      className: 'some-custom-class', 
      style: {
        backGroundColor: 'periwinkle'
      }
    })}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-07-14
      • 1970-01-01
      • 1970-01-01
      • 2011-06-23
      • 2015-04-28
      • 2020-04-28
      • 2014-08-24
      • 2015-01-24
      相关资源
      最近更新 更多