Commit cf9a399e7e71f72fac061a4c4cb7dee006a45740
1 parent
145be7a6
修改showInkInFixed为showInk,如果设为true则永远显示小圆点
Showing
2 changed files
with
3 additions
and
6 deletions
Show diff stats
examples/routers/anchor.vue
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <div class="link-wrapper"> | 3 | <div class="link-wrapper"> |
4 | <Button @click="changeCon">修改为Window</Button> | 4 | <Button @click="changeCon">修改为Window</Button> |
5 | <Button @click="andLink">添加一个连接</Button> | 5 | <Button @click="andLink">添加一个连接</Button> |
6 | - <Anchor :bounds="100" @on-change="handleChange" @on-select="handleSelect" :style="{right: '100px'}" :affix="true" :offset-top="30" :scroll-offset="100" :container="scrollCon" show-ink-in-fixed> | 6 | + <Anchor :bounds="100" @on-change="handleChange" @on-select="handleSelect" :style="{right: '100px'}" :affix="true" :offset-top="30" :scroll-offset="100" :container="scrollCon" show-ink> |
7 | <AnchorLink v-if="(link - 1) % 30 === 0" v-for="link in 300" :key="`link${link}`" :href="`#title-${link}`" :title="`title-${link}`"> | 7 | <AnchorLink v-if="(link - 1) % 30 === 0" v-for="link in 300" :key="`link${link}`" :href="`#title-${link}`" :title="`title-${link}`"> |
8 | <AnchorLink :scroll-offset="20" v-if="link === 61" href="#title-child-69" title="title-child-69"/> | 8 | <AnchorLink :scroll-offset="20" v-if="link === 61" href="#title-child-69" title="title-child-69"/> |
9 | </AnchorLink> | 9 | </AnchorLink> |
src/components/anchor/anchor.vue
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <div :class="`${prefix}-wrapper`" :style="wrapperStyle"> | 3 | <div :class="`${prefix}-wrapper`" :style="wrapperStyle"> |
4 | <div :class="`${prefix}`"> | 4 | <div :class="`${prefix}`"> |
5 | <div :class="`${prefix}-ink`"> | 5 | <div :class="`${prefix}-ink`"> |
6 | - <span v-show="showInkBall" :class="`${prefix}-ink-ball`" :style="{top: `${inkTop}px`}"></span> | 6 | + <span v-show="showInk" :class="`${prefix}-ink-ball`" :style="{top: `${inkTop}px`}"></span> |
7 | </div> | 7 | </div> |
8 | <slot></slot> | 8 | <slot></slot> |
9 | </div> | 9 | </div> |
@@ -50,7 +50,7 @@ export default { | @@ -50,7 +50,7 @@ export default { | ||
50 | default: 5 | 50 | default: 5 |
51 | }, | 51 | }, |
52 | container: [String, HTMLElement], | 52 | container: [String, HTMLElement], |
53 | - showInkInFixed: { | 53 | + showInk: { |
54 | type: Boolean, | 54 | type: Boolean, |
55 | default: false | 55 | default: false |
56 | }, | 56 | }, |
@@ -70,9 +70,6 @@ export default { | @@ -70,9 +70,6 @@ export default { | ||
70 | }, | 70 | }, |
71 | containerIsWindow () { | 71 | containerIsWindow () { |
72 | return this.scrollContainer === window; | 72 | return this.scrollContainer === window; |
73 | - }, | ||
74 | - showInkBall () { | ||
75 | - return this.showInkInFixed && (this.isAffixed || (!this.isAffixed && !this.upperFirstTitle && this.scrollContainer !== window)); | ||
76 | } | 73 | } |
77 | }, | 74 | }, |
78 | methods: { | 75 | methods: { |