mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-04 04:08:34 +08:00
38 lines
1.2 KiB
Vue
38 lines
1.2 KiB
Vue
<template>
|
|
<el-anchor :offset="70" @change="handleChange">
|
|
<el-anchor-link :href="`#${locale['basic-usage']}`">
|
|
{{ locale['Basic Usage'] }}
|
|
</el-anchor-link>
|
|
<el-anchor-link :href="`#${locale['horizontal-mode']}`">
|
|
{{ locale['Horizontal Mode'] }}
|
|
</el-anchor-link>
|
|
<el-anchor-link :href="`#${locale['scroll-container']}`">
|
|
{{ locale['Scroll Container'] }}
|
|
</el-anchor-link>
|
|
<el-anchor-link :href="`#${locale['anchor-api']}`">
|
|
{{ locale['Anchor API'] }}
|
|
<template #sub-link>
|
|
<el-anchor-link :href="`#${locale['anchor-attributes']}`">
|
|
{{ locale['Anchor Attributes'] }}
|
|
</el-anchor-link>
|
|
<el-anchor-link :href="`#${locale['anchor-events']}`">
|
|
{{ locale['Anchor Events'] }}
|
|
</el-anchor-link>
|
|
</template>
|
|
</el-anchor-link>
|
|
</el-anchor>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import anchorLocale from '../../.vitepress/i18n/component/anchor.json'
|
|
import { useLang } from '~/composables/lang'
|
|
|
|
const lang = useLang()
|
|
const locale = computed(() => anchorLocale[lang.value])
|
|
|
|
const handleChange = (href: string) => {
|
|
console.log(`anchor change: ${href}`)
|
|
}
|
|
</script>
|