Commit 2b749d9588a9c4af1d6e8f214fa1888ee8a50f42
1 parent
754eedf5
commit
Showing
3 changed files
with
6 additions
and
2 deletions
Show diff stats
examples/routers/anchor.vue
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 | <AnchorLink v-if="(link - 1) % 30 === 0" v-for="link in 300" :key="`link${link}`" :href="`#title-${link}`" :title="`title-${link}`"> |
8 | 8 | <AnchorLink v-if="link === 61" href="#title-child-69" title="title-child-69"/> |
9 | 9 | </AnchorLink> |
10 | + <AnchorLink href="#lishi" title="李氏专跳"/> | |
10 | 11 | <AnchorLink v-if="showNewLink" href="#new-link" title="这是动态添加的连接"/> |
11 | 12 | </Anchor> |
12 | 13 | </div> |
... | ... | @@ -32,6 +33,8 @@ |
32 | 33 | </Panel> |
33 | 34 | </Collapse> |
34 | 35 | </template> |
36 | + <h1 id="lishi">李氏专跳</h1> | |
37 | + <p v-for="i in 100" :key="`chinese-${i}`">这是信息司大是大非胜多负少的{{i}}</p> | |
35 | 38 | <!-- <h1 id="new-link">这是新添加的哦哦哦哦哦 哦 </h1> |
36 | 39 | <p v-for="i in 50" :key="`new-${i}`">这是信息司大是大非胜多负少的{{i}}</p> --> |
37 | 40 | </div> |
... | ... | @@ -58,6 +61,8 @@ |
58 | 61 | </template> |
59 | 62 | <h1 id="new-link">这是新添加的哦哦哦哦哦 哦 </h1> |
60 | 63 | <p v-for="i in 50" :key="`new-${i}`">这是信息司大是大非胜多负少的{{i}}</p> |
64 | + <h1 id="lishi">李氏专跳</h1> | |
65 | + <p v-for="i in 50" :key="`chinese-${i}`">这是信息司大是大非胜多负少的{{i}}</p> | |
61 | 66 | </div> |
62 | 67 | |
63 | 68 | </div> | ... | ... |
src/components/anchor/anchor-link.vue
1 | 1 | <template> |
2 | 2 | <div :class="anchorLinkClasses"> |
3 | - <a :class="linkTitleClasses" href="javascript:void(0)" :data-href="href" @click="goAnchor" :title="title">{{ title }}</a> | |
3 | + <a :class="linkTitleClasses" :href="href" :data-href="href" @click.prevent="goAnchor" :title="title">{{ title }}</a> | |
4 | 4 | <slot></slot> |
5 | 5 | </div> |
6 | 6 | </template> | ... | ... |
src/styles/components/index.less