mirror of
https://github.com/tachiyomiorg/website.git
synced 2024-10-31 23:15:05 +01:00
Fix lint for two specific components. (#28)
This commit is contained in:
parent
18fe3d7044
commit
f8a1fecae8
@ -1,12 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue"
|
||||
import { type DefaultTheme, useData } from "vitepress"
|
||||
|
||||
import { data as release } from "../data/release.data"
|
||||
import { useData } from "vitepress"
|
||||
import type { DefaultTheme } from "vitepress/theme"
|
||||
|
||||
import VPNavBarMenuLink from "vitepress/dist/client/theme-default/components/VPNavBarMenuLink.vue"
|
||||
import VPNavBarMenuGroup from "vitepress/dist/client/theme-default/components/VPNavBarMenuGroup.vue"
|
||||
|
||||
import { data as release } from "../data/release.data"
|
||||
|
||||
const { theme } = useData<DefaultTheme.Config>()
|
||||
|
||||
/**
|
||||
@ -21,7 +22,7 @@ const nav = computed(() => {
|
||||
|
||||
const appVersion = release.stable.tag_name.substring(1)
|
||||
|
||||
return <DefaultTheme.NavItemWithChildren> {
|
||||
return {
|
||||
...item,
|
||||
text: item.text === "{app_version}" ? appVersion : item.text,
|
||||
items: (item as DefaultTheme.NavItemWithChildren).items.map((child) => {
|
||||
@ -29,12 +30,12 @@ const nav = computed(() => {
|
||||
return child
|
||||
}
|
||||
|
||||
return <DefaultTheme.NavItemWithLink> {
|
||||
return {
|
||||
...child,
|
||||
link: child.link.replace("{app_version}", appVersion),
|
||||
}
|
||||
} satisfies DefaultTheme.NavItemWithLink
|
||||
}),
|
||||
}
|
||||
} satisfies DefaultTheme.NavItemWithChildren
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
@ -2,11 +2,11 @@
|
||||
import { computed } from "vue"
|
||||
import { type DefaultTheme, useData } from "vitepress"
|
||||
|
||||
import { data as release } from "../data/release.data"
|
||||
|
||||
import VPNavScreenMenuLink from "vitepress/dist/client/theme-default/components/VPNavScreenMenuLink.vue"
|
||||
import VPNavScreenMenuGroup from "vitepress/dist/client/theme-default/components/VPNavScreenMenuGroup.vue"
|
||||
|
||||
import { data as release } from "../data/release.data"
|
||||
|
||||
const { theme } = useData<DefaultTheme.Config>()
|
||||
|
||||
/**
|
||||
@ -21,7 +21,7 @@ const nav = computed(() => {
|
||||
|
||||
const appVersion = release.stable.tag_name.substring(1)
|
||||
|
||||
return <DefaultTheme.NavItemWithChildren> {
|
||||
return {
|
||||
...item,
|
||||
text: item.text === "{app_version}" ? appVersion : item.text,
|
||||
items: (item as DefaultTheme.NavItemWithChildren).items.map((child) => {
|
||||
@ -29,12 +29,12 @@ const nav = computed(() => {
|
||||
return child
|
||||
}
|
||||
|
||||
return <DefaultTheme.NavItemWithLink> {
|
||||
return {
|
||||
...child,
|
||||
link: child.link.replace("{app_version}", appVersion),
|
||||
}
|
||||
} satisfies DefaultTheme.NavItemWithLink
|
||||
}),
|
||||
}
|
||||
} satisfies DefaultTheme.NavItemWithChildren
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@ -42,15 +42,15 @@ const nav = computed(() => {
|
||||
<template>
|
||||
<nav v-if="nav" class="VPNavScreenMenu">
|
||||
<template v-for="item in nav" :key="item.text">
|
||||
<VPNavScreenMenuLink
|
||||
v-if="'link' in item"
|
||||
:item="item"
|
||||
/>
|
||||
<VPNavScreenMenuGroup
|
||||
v-else
|
||||
:text="item.text || ''"
|
||||
:items="item.items"
|
||||
/>
|
||||
<VPNavScreenMenuLink
|
||||
v-if="'link' in item"
|
||||
:item="item"
|
||||
/>
|
||||
<VPNavScreenMenuGroup
|
||||
v-else
|
||||
:text="item.text || ''"
|
||||
:items="item.items"
|
||||
/>
|
||||
</template>
|
||||
</nav>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user