Browse Source

feat: update demo about cell-render in date-picker (#43597)

pull/43620/head
kiner-tang(文辉) 1 year ago
committed by GitHub
parent
commit
9ddad8662a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      components/date-picker/demo/cell-render.tsx

6
components/date-picker/demo/cell-render.tsx

@ -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…
Cancel
Save