Merge pull request #4009 from lison16/anchor

修改showInkInFixed为showInk,如果设为true则永远显示小圆点
This commit is contained in:
Aresn 2018-07-02 17:23:05 +08:00 committed by GitHub
commit 7dc6a8c3b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View file

@ -3,7 +3,7 @@
<div class="link-wrapper">
<Button @click="changeCon">修改为Window</Button>
<Button @click="andLink">添加一个连接</Button>
<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>
<Anchor :bounds="100" @on-change="handleChange" @on-select="handleSelect" :style="{right: '100px'}" :affix="true" :offset-top="30" :scroll-offset="100" :container="scrollCon" show-ink>
<AnchorLink v-if="(link - 1) % 30 === 0" v-for="link in 300" :key="`link${link}`" :href="`#title-${link}`" :title="`title-${link}`">
<AnchorLink :scroll-offset="20" v-if="link === 61" href="#title-child-69" title="title-child-69"/>
</AnchorLink>

View file

@ -3,7 +3,7 @@
<div :class="`${prefix}-wrapper`" :style="wrapperStyle">
<div :class="`${prefix}`">
<div :class="`${prefix}-ink`">
<span v-show="showInkBall" :class="`${prefix}-ink-ball`" :style="{top: `${inkTop}px`}"></span>
<span v-show="showInk" :class="`${prefix}-ink-ball`" :style="{top: `${inkTop}px`}"></span>
</div>
<slot></slot>
</div>
@ -50,7 +50,7 @@ export default {
default: 5
},
container: [String, HTMLElement],
showInkInFixed: {
showInk: {
type: Boolean,
default: false
},
@ -70,9 +70,6 @@ export default {
},
containerIsWindow () {
return this.scrollContainer === window;
},
showInkBall () {
return this.showInkInFixed && (this.isAffixed || (!this.isAffixed && !this.upperFirstTitle && this.scrollContainer !== window));
}
},
methods: {