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 = {
3737const MyInput = React . forwardRef < HTMLInputElement , React . InputHTMLAttributes < HTMLInputElement > > (
3838 ( props , ref ) => {
3939 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+ ) ;
4172 } ,
4273) ;
4374MyInput . displayName = 'MyInput' ;
@@ -61,11 +92,11 @@ export default () => {
6192 < RangePicker
6293 { ...sharedLocale }
6394 value = { rangeValue }
64- components = { {
65- input : MyInput ,
66- } }
95+ // components={{
96+ // input: MyInput,
97+ // }}
6798 // showTime
68- showNow
99+ panelRender = { ( ori ) => < > 2333 { ori } </ > }
69100 placeholder = { [ 'Start' , 'End' ] }
70101 suffixIcon = "🧶"
71102 onFocus = { ( _ , info ) => {
You can’t perform that action at this time.
0 commit comments