我一直在使用timepicker并尝试自定义弹出窗口,我可能需要在弹出窗口中添加一个类。我尝试使用“popupClassName”,但我没有看到类名被添加到弹出窗口中。
请告诉我如何在timepicker弹出窗口中添加一个类。
答案 0 :(得分:0)
它确实有效。请参阅https://codepen.io/JesperWe/pen/RVOwOV,它会添加一个类和一些CSS,为弹出窗口提供一个红色阴影。
<TimePicker defaultValue={moment()} popupClassName="foobar"/>
结果:
<div class="ant-time-picker-panel foobar ant-time-picker-panel-column-3 ant-time-picker-panel-placement-bottomLeft"
style="left: 24px; top: 63.7778px;">
<div class="ant-time-picker-panel-inner">
<div class="ant-time-picker-panel-input-wrap">
<input class="ant-time-picker-panel-input" value="02:32:41" placeholder="Select time"><a
class="ant-time-picker-panel-clear-btn" role="button" title="clear"></a>
</div>
<div class="ant-time-picker-panel-combobox">
<div class="ant-time-picker-panel-select">
<ul>...</ul>
</div>
<div class="ant-time-picker-panel-select">
<ul>...</ul>
</div>
</div>
</div>
</div>