Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Dec 5, 2023
1 parent b923033 commit f65ef7e
Showing 1 changed file with 36 additions and 5 deletions.
41 changes: 36 additions & 5 deletions docs/examples/debug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,38 @@ const sharedLocale = {
const MyInput = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<HTMLInputElement>>(
(props, ref) => {
console.log('>>>', props);
return <input {...props} ref={ref} />;
const { 'data-range': range, value, style } = props as any;

// return (
// <div>
// <input {...props} ref={ref} />
// </div>
// );

return (
<div style={{ position: 'relative' }}>
<input
{...props}
style={{
...style,
opacity: value ? 1 : 0,
}}
ref={ref}
/>
{!value && (
<div
style={{
position: 'absolute',
left: 0,
top: 0,
pointerEvents: 'none',
}}
>
{range === 'start' ? '从未' : '至今'}
</div>
)}
</div>
);
},
);
MyInput.displayName = 'MyInput';
Expand All @@ -61,11 +92,11 @@ export default () => {
<RangePicker
{...sharedLocale}
value={rangeValue}
components={{
input: MyInput,
}}
// components={{
// input: MyInput,
// }}
// showTime
showNow
panelRender={(ori) => <>2333{ori}</>}
placeholder={['Start', 'End']}
suffixIcon="🧶"
onFocus={(_, info) => {
Expand Down

0 comments on commit f65ef7e

Please sign in to comment.