Skip to content

Commit d82ad34

Browse files
committed
feat: md文件引入demo
1 parent 18dc387 commit d82ad34

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

devui/anchor/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { App } from 'vue'
2-
import Anchor from '../../sites/components/anchor/demo'
2+
import Anchor from './src/anchor'
33
import dAnchorBox from './src/d-anchor-box'
44
import dAnchorLink from './src/d-anchor-link'
55
import dAnchor from './src/d-anchor'

devui/anchor/src/util.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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');

sites/components/anchor/index.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
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>

0 commit comments

Comments
 (0)