We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
` handleTabClick(activeIndex) { const prevIndex = this.state.activeIndex;
if (this.state.activeIndex !== activeIndex && 'defaultActiveIndex' in this.props) { this.setState({ activeIndex, prevIndex, }); this.props.onChange({ activeIndex, prevIndex }); }
}` 文中对上面的代码描述是:然后,在 tab 点击事件上,对是否存在 defaultActiveIndex prop 进行判断即可达到在传入 defaultActiveIndex 时使用内部更新,当传入 activeIndex 时使用外部传入的 props 更新。 相关代码如下。
可是仔细看这段代码,只是对传入defaultActiveIndex传入时进行了判断,并没有兼容activeIndex传入时的操作,因为这里面只有一个if判断然后剩下的代码就是if为true时执行的代码,if里面只是判断defaultActiveIndex传入时。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
` handleTabClick(activeIndex) {
const prevIndex = this.state.activeIndex;
}`
文中对上面的代码描述是:然后,在 tab 点击事件上,对是否存在 defaultActiveIndex prop 进行判断即可达到在传入 defaultActiveIndex 时使用内部更新,当传入 activeIndex 时使用外部传入的 props 更新。
相关代码如下。
可是仔细看这段代码,只是对传入defaultActiveIndex传入时进行了判断,并没有兼容activeIndex传入时的操作,因为这里面只有一个if判断然后剩下的代码就是if为true时执行的代码,if里面只是判断defaultActiveIndex传入时。
The text was updated successfully, but these errors were encountered: