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
if (_this.props.onClick) _this.props.onClick(event); if (!event.defaultPrevented && // onClick prevented default event.button === 0 && // ignore everything but left clicks !_this.props.target && // let browser handle "target=_blank" etc. !isModifiedEvent(event) // ignore clicks with modifier keys ) { event.preventDefault(); var history = _this.context.router.history; var _this$props = _this.props, replace = _this$props.replace, to = _this$props.to; if (replace) { history.replace(to); } else { history.push(to); } }
Link做了3件事情:
总的来说Link:
从最终渲染的 DOM 来看,这两者都是链接,都是 标签,区别是:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Link做了3件事情:
总的来说Link:
从最终渲染的 DOM 来看,这两者都是链接,都是 标签,区别是:
是 react-router 里实现路由跳转的链接,一般配合 使用,react-router 接管了其默认的链接跳转行为,区别于传统的页面跳转, 的“跳转”行为只会触发相匹配的 对应的页面内容更新,而不会刷新整个页面。 而 标签就是普通的超链接了,用于从当前页面跳转到 href 指向的另一个页面(非锚点情况)。The text was updated successfully, but these errors were encountered: