mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +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>
|