mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 21:19:37 +08:00
10 lines
428 B
HTML
10 lines
428 B
HTML
<script>
|
|
var prefix = /^\/components/.test(location.pathname) ? location.pathname.replace(/^\//, '').split('/').join('-') : '';
|
|
var scrollToString = location.hash ? '?scrollTo=' + prefix + location.hash : '';
|
|
if (location.pathname === '/changelog') {
|
|
location.href = '/#/docs/react/changelog' + scrollToString;
|
|
} else {
|
|
location.href = '/#' + location.pathname.replace(/\/$/, '') + scrollToString;
|
|
}
|
|
</script>
|