11<script lang="ts" setup>
22import { useRoute } from ' vitepress'
33import { computed } from ' vue'
4+ import { withoutLeadingSlash , withoutTrailingSlash } from ' ufo'
45
56const route = useRoute ()
67
@@ -21,18 +22,21 @@ const show = computed(() => {
2122})
2223
2324const componentPath = computed (() => {
24- return route .path .replace (' /index.md' , ' ' )
25+ return withoutTrailingSlash ( withoutLeadingSlash ( route .path .replace (' /index.md' , ' ' )) )
2526})
2627
2728const componentName = computed (() => {
2829 return componentPath .value .split (' /' ).pop ()
2930})
3031
3132const viewComponent = computed (() => {
32- return ` https://github.com/barbapapazes-sponsors/vue-ui/blob/main/src${componentPath .value } `
33+ return ` https://github.com/barbapapazes-sponsors/vue-ui/blob/main/src/ ${componentPath .value } `
3334})
3435const editComponent = computed (() => {
35- return ` https://github.com/barbapapazes-sponsors/vue-ui/edit/main/src${componentPath .value }/${componentName .value }.vue `
36+ return ` https://github.com/barbapapazes-sponsors/vue-ui/edit/main/src/${componentPath .value }/${componentName .value }.vue `
37+ })
38+ const openIssue = computed (() => {
39+ return ` https://github.com/barbapapazes-sponsors/vue-ui/issues/new?title=[${componentName .value }]%20 `
3640})
3741 </script >
3842
@@ -47,6 +51,11 @@ const editComponent = computed(() => {
4751 View on GitHub
4852 </a >
4953
54+ <a :href =" openIssue" target =" _blank" class =" flex flex-row items-center text-(--vp-c-text-2)! text-sm transition-colors duration-[250ms] leading-8 hover:text-(--vp-c-text-1)!" >
55+ <span class =" i-lucide-message-square mr-2 size-4" />
56+ Open an issue
57+ </a >
58+
5059 <a :href =" editComponent" target =" _blank" class =" flex flex-row items-center text-(--vp-c-text-2)! text-sm transition-colors duration-[250ms] leading-8 hover:text-(--vp-c-text-1)!" >
5160 <span class =" i-lucide-pen mr-2 size-4" />
5261 Edit the component
0 commit comments