-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathAppBar.vue
More file actions
31 lines (27 loc) · 945 Bytes
/
AppBar.vue
File metadata and controls
31 lines (27 loc) · 945 Bytes
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
<template>
<v-app-bar :elevation="1">
<v-app-bar-title>
Scapy
</v-app-bar-title>
<v-btn :onclick="scrollToDownloads">
Downloads
</v-btn>
<v-btn href="https://scapy.readthedocs.io">
<span class="mr-1">Doc<span class="hidden-xs">umentation</span></span> <v-icon :icon="mdiOpenInNew"></v-icon>
</v-btn>
<v-btn icon href="https://github.com/secdev/scapy">
<img :src="githubAsset" height="30" />
</v-btn>
</v-app-bar>
</template>
<script lang="ts" setup>
import githubAsset from '@/assets/logos/github-mark-white.svg';
import { inject } from 'vue'
import type { Ref } from 'vue'
import { mdiOpenInNew } from '@mdi/js'
/* Define a function and a reference to scroll to the Downloads section */
const downloads_section = inject<Ref<HTMLDivElement | null>>('downloads_section');
function scrollToDownloads() {
downloads_section?.value?.scrollIntoView({ behavior: 'smooth' })
}
</script>