File tree Expand file tree Collapse file tree 1 file changed +36
-5
lines changed Expand file tree Collapse file tree 1 file changed +36
-5
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,38 @@ const sharedLocale = {
37
37
const MyInput = React . forwardRef < HTMLInputElement , React . InputHTMLAttributes < HTMLInputElement > > (
38
38
( props , ref ) => {
39
39
console . log ( '>>>' , props ) ;
40
- return < input { ...props } ref = { ref } /> ;
40
+ const { 'data-range' : range , value, style } = props as any ;
41
+
42
+ // return (
43
+ // <div>
44
+ // <input {...props} ref={ref} />
45
+ // </div>
46
+ // );
47
+
48
+ return (
49
+ < div style = { { position : 'relative' } } >
50
+ < input
51
+ { ...props }
52
+ style = { {
53
+ ...style ,
54
+ opacity : value ? 1 : 0 ,
55
+ } }
56
+ ref = { ref }
57
+ />
58
+ { ! value && (
59
+ < div
60
+ style = { {
61
+ position : 'absolute' ,
62
+ left : 0 ,
63
+ top : 0 ,
64
+ pointerEvents : 'none' ,
65
+ } }
66
+ >
67
+ { range === 'start' ? '从未' : '至今' }
68
+ </ div >
69
+ ) }
70
+ </ div >
71
+ ) ;
41
72
} ,
42
73
) ;
43
74
MyInput . displayName = 'MyInput' ;
@@ -61,11 +92,11 @@ export default () => {
61
92
< RangePicker
62
93
{ ...sharedLocale }
63
94
value = { rangeValue }
64
- components = { {
65
- input : MyInput ,
66
- } }
95
+ // components={{
96
+ // input: MyInput,
97
+ // }}
67
98
// showTime
68
- showNow
99
+ panelRender = { ( ori ) => < > 2333 { ori } </ > }
69
100
placeholder = { [ 'Start' , 'End' ] }
70
101
suffixIcon = "🧶"
71
102
onFocus = { ( _ , info ) => {
You can’t perform that action at this time.
0 commit comments