将样式/类添加到 react-datepicker [英] Add style/class to react-datepicker
本文介绍了将样式/类添加到 react-datepicker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
那么基本上我如何添加一个css类?我已经试过了,但它不起作用:
So basicly how do I add a css class? I've given this a go but it ain't working:
<DatePicker
className="form-control
dateInput"
selected={startDate}
onChange={function(date){
startDate = date;
}
}
/>
谢谢,埃德.(顺便说一下是用webpack编译的.)
Thanks, Ed. (It's been compiled with webpack by the way.)
推荐答案
根据您要添加 css 类的位置,您可以使用 className
prop 或 popperClassName
.有关更多信息,请阅读文档:https://github.com/Hacker0x01/react-datepicker/blob/master/docs/datepicker.md
Depending on where you want to add the css class, you can either use className
prop or popperClassName
. For more, please read the docs: https://github.com/Hacker0x01/react-datepicker/blob/master/docs/datepicker.md
这篇关于将样式/类添加到 react-datepicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文