Skip to content

Commit

Permalink
fix: 切换组件时,文档滚动条位置不变
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuokuang committed Oct 31, 2022
1 parent f530fda commit ff9066f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion example/src/sites/doc/views/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<doc-nav></doc-nav>

<div class="doc-content">
<div id="doc-content" class="doc-content">
<div class="doc-title" v-if="isShow()">
<div class="doc-title-position" :class="{ fixed: fixed, hidden: hidden }">
<div class="title">{{ componentName.name }}&nbsp;{{ isZhLang ? componentName.cName : '' }}</div>
Expand Down Expand Up @@ -175,6 +175,7 @@ export default defineComponent({
watchDemoUrl(to);
data.curKey = isReact(to) ? "react" : "vue";
componentTitle(to);
document.getElementById('doc-content')?.scrollTo({ top: 0 });
});
Expand All @@ -191,12 +192,15 @@ export default defineComponent({
<style lang="scss" scoped>
.doc {
&-content {
height: calc(100vh - 68px);
overflow: auto;
margin-left: 290px;
display: flex;
flex-direction: column;
&-document {
min-height: 800px;
flex-shrink: 0;
}
&-tabs {
Expand Down

0 comments on commit ff9066f

Please sign in to comment.