ant-design-vue/components/anchor/demo/onChange.vue

43 lines
887 B
Vue

<docs>
---
order: 5
title:
zh-CN: ᛑåŦé”šį‚šé“žæŽĨ攚变
en-US: Listening for anchor link change
---
## zh-CN
ᛑåŦé”šį‚šé“žæŽĨ攚变。
## en-US
Listening for anchor link change.
</docs>
<template>
<a-anchor :affix="false" @change="onChange">
<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';
export default defineComponent({
setup() {
const onChange = (link: string) => {
console.log('Anchor:OnChange', link);
};
return {
onChange,
};
},
});
</script>