mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-11 23:00:20 +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>
|