mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
feat: update demo about cell-render in date-picker (#43597)
This commit is contained in:
parent
e825e781de
commit
9ddad8662a
@ -6,7 +6,8 @@ const { RangePicker } = DatePicker;
|
|||||||
const App: React.FC = () => (
|
const App: React.FC = () => (
|
||||||
<Space direction="vertical" size={12}>
|
<Space direction="vertical" size={12}>
|
||||||
<DatePicker
|
<DatePicker
|
||||||
cellRender={(current) => {
|
cellRender={(current, info) => {
|
||||||
|
if (info.type !== 'date') return info.originNode;
|
||||||
const style: React.CSSProperties = {};
|
const style: React.CSSProperties = {};
|
||||||
if (current.date() === 1) {
|
if (current.date() === 1) {
|
||||||
style.border = '1px solid #1677ff';
|
style.border = '1px solid #1677ff';
|
||||||
@ -20,7 +21,8 @@ const App: React.FC = () => (
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<RangePicker
|
<RangePicker
|
||||||
cellRender={(current) => {
|
cellRender={(current, info) => {
|
||||||
|
if (info.type !== 'date') return info.originNode;
|
||||||
const style: React.CSSProperties = {};
|
const style: React.CSSProperties = {};
|
||||||
if (current.date() === 1) {
|
if (current.date() === 1) {
|
||||||
style.border = '1px solid #1677ff';
|
style.border = '1px solid #1677ff';
|
||||||
|
Loading…
Reference in New Issue
Block a user