-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathonClick.vue
44 lines (37 loc) · 979 Bytes
/
onClick.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<docs>
---
order: 2
title:
zh-CN: 自定义 click 事件
en-US: Customize the click event
---
## zh-CN
点击锚点不记录历史。
## en-US
Clicking on an anchor does not record history.
</docs>
<template>
<a-anchor :affix="false" @click="handleClick">
<a-anchor-link href="#components-anchor-demo-basic" title="Basic demo" />
<a-anchor-link href="#components-anchor-demo-static" title="Static demo" />
<a-anchor-link href="#API" title="API">
<a-anchor-link href="#Anchor-Props" title="Anchor Props" />
<a-anchor-link href="#Link-Props" title="Link Props" />
</a-anchor-link>
</a-anchor>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import type { AnchorProps } from 'ant-design-vue';
export default defineComponent({
setup() {
const handleClick: AnchorProps['onClick'] = (e, link) => {
e.preventDefault();
console.log(link);
};
return {
handleClick,
};
},
});
</script>