File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 11import { App } from 'vue'
2- import Anchor from '../../sites/components/ anchor/demo '
2+ import Anchor from './src/ anchor'
33import dAnchorBox from './src/d-anchor-box'
44import dAnchorLink from './src/d-anchor-link'
55import dAnchor from './src/d-anchor'
Original file line number Diff line number Diff line change @@ -138,7 +138,6 @@ function activateLink(hash:string | boolean):void {
138138 //
139139 // also add active class to parent h2 anchors
140140 const rootLi = activeLink . closest ( '.mycontainer > ul > li' ) ;
141- // console.log(rootLi,'9999999')
142141 if ( rootLi && rootLi !== activeLink . parentElement ) {
143142 rootActiveLink = rootLi ;
144143 rootActiveLink && rootActiveLink . classList . add ( 'active' ) ;
Original file line number Diff line number Diff line change 11# anchor 锚点
2-
3- <d-anchor />
2+ <script lang =" ts " >
3+ import { defineComponent } from ' vue'
4+ import deAnchor from ' ./demo'
5+ export default defineComponent ({
6+ components: {
7+ deAnchor
8+ }
9+ })
10+ </script >
11+ <de-anchor />
12+
413# 如何使用
514
615
716
817在页面中使用:
918
1019``` html
20+ <!-- class="scrollTarget" 加上这个类名是局部滚动,不加是全局滚动 -->
1121<div v-d-anchor-box class =" scrollTarget" >
1222 <ul >
1323 <li v-d-anchor-link =" anchorlink-one" >anchorlink-one</li >
You can’t perform that action at this time.
0 commit comments