Ant Design Input 控件设置默认焦点

     <Input
                      ref={input => {
                        input.input.setSelectionRange(0, input.state.value.length); // 选中内容
                        input.focus();  // 设置焦点
                      }}
                      maxLength={9}
                    />

猜你喜欢

转载自www.cnblogs.com/beibeihe/p/11626735.html
今日推荐