Skip to content

Commit 3798ad4

Browse files
committed
refactor(link): exports AnchorLinkSlots type
1 parent eede649 commit 3798ad4

5 files changed

Lines changed: 16 additions & 13 deletions

File tree

src/anchor/demos/enUS/index.demo-entry.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ scrollto.vue
3232
| Name | Type | Default | Description |
3333
| ----- | -------- | ----------- | ------------------- |
3434
| href | `string` | `undefined` | The target of link |
35-
| title | `stirng` | `undefined` | The content of link |
35+
| title | `string` | `undefined` | The content of link |
3636

3737
### AnchorLink Slots
3838

39-
| 名称 | 类型 | 说明 | 版本 |
40-
| ----- | ------------- | ------------------- | ------------ |
41-
| title | `() => VNode` | The content of link | NEXT_VERSION |
39+
| Name | Parameters | Description | Version |
40+
| ----- | ---------- | ---------------------- | ------------ |
41+
| title | `()` | The title of the link. | NEXT_VERSION |
4242

4343
### Anchor Methods
4444

src/anchor/demos/zhCN/index.demo-entry.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ max-height-debug.vue
3737

3838
### AnchorLink Slots
3939

40-
| 名称 | 类型 | 说明 | 版本 |
41-
| ----- | ------------- | -------- | ------------ |
42-
| title | `() => VNode` | 锚点标题 | NEXT_VERSION |
40+
| 名称 | 参数 | 说明 | 版本 |
41+
| ----- | ---- | -------- | ------------ |
42+
| title | `()` | 锚点标题 | NEXT_VERSION |
4343

4444
### Anchor Methods
4545

src/anchor/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ export { anchorProps, default as NAnchor } from './src/AnchorAdapter'
22
export type { AnchorInst, AnchorProps } from './src/AnchorAdapter'
33
export { anchorLinkProps, default as NAnchorLink } from './src/Link'
44
export type { AnchorLinkProps } from './src/Link'
5+
export type * from './src/public-types'

src/anchor/src/Link.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import type { Ref, SlotsType, VNode } from 'vue'
1+
import type { Ref, SlotsType } from 'vue'
2+
import type { AnchorLinkSlots } from './public-types'
23
import { useMemo } from 'vooks'
34
import { defineComponent, h, inject, ref, toRef, watch } from 'vue'
45
import {
@@ -31,11 +32,6 @@ export const anchorLinkProps = {
3132

3233
export type AnchorLinkProps = ExtractPublicPropTypes<typeof anchorLinkProps>
3334

34-
export interface AnchorLinkSlots {
35-
default?: () => VNode[]
36-
title?: () => VNode[]
37-
}
38-
3935
export default defineComponent({
4036
name: 'AnchorLink',
4137
props: anchorLinkProps,

src/anchor/src/public-types.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type { VNode } from 'vue'
2+
3+
export interface AnchorLinkSlots {
4+
default?: () => VNode[]
5+
title?: () => VNode[]
6+
}

0 commit comments

Comments
 (0)