|
17 | 17 | <span class="docs-header-spacer"></span>
|
18 | 18 | </header>
|
19 | 19 | <div class="docs-content" id="doc-layout-scoller">
|
20 |
| - <div class="ti-fi-1 ti-rel cmp-container"> |
| 20 | + <div class="ti-rel cmp-container"> |
21 | 21 | <div class="flex-horizontal docs-content-main">
|
22 | 22 | <div class="docs-tabs-wrap">
|
23 | 23 | <div v-if="['interfaces', 'types', 'classes'].includes(cmpId)" id="TS" class="all-api-container">
|
|
235 | 235 | <div class="cmp-page-anchor catalog" v-if="currAnchorLinks.length">
|
236 | 236 | <tiny-anchor
|
237 | 237 | id="anchor"
|
238 |
| - :offset-top="156" |
239 | 238 | :links="currAnchorLinks"
|
240 | 239 | :key="anchorRefreshKey"
|
241 | 240 | :is-affix="anchorAffix"
|
242 | 241 | type="dot"
|
243 |
| - mask-class="custom-active-anchor" |
244 | 242 | container-id="#doc-layout-scoller"
|
245 | 243 | @link-click="handleAnchorClick"
|
246 | 244 | >
|
@@ -486,8 +484,10 @@ export default defineComponent({
|
486 | 484 | scrollTarget = document.querySelector(`#${hash}`)
|
487 | 485 | } catch (err) {}
|
488 | 486 | if (scrollTarget && !isRunningTest) {
|
| 487 | + // doc-layout-scoller(滚动) > tabs > tab-content(relative), 造成 scrollTarget.offsetTop 是相对于 tab-content的距离 |
| 488 | + // 所以滚动需要修正 tab-title的占位高度才行 |
489 | 489 | document.getElementById('doc-layout-scoller').scrollTo({
|
490 |
| - top: scrollTarget.offsetTop, |
| 490 | + top: scrollTarget.offsetTop + 52, |
491 | 491 | left: 0,
|
492 | 492 | behavior: 'smooth'
|
493 | 493 | })
|
@@ -767,9 +767,6 @@ export default defineComponent({
|
767 | 767 |
|
768 | 768 | <style lang="less" scoped>
|
769 | 769 | .docs-header {
|
770 |
| - position: sticky; |
771 |
| - top: 0; |
772 |
| - z-index: var(--docs-header-zindex); |
773 | 770 | padding: 16px 40px;
|
774 | 771 | background-color: #fff;
|
775 | 772 | box-shadow: 12px 0 20px 6px rgba(0, 0, 0, 0.06);
|
|
0 commit comments