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">
|
<script setup lang="ts">
|
||||||
import { computed } from "vue"
|
import { computed } from "vue"
|
||||||
import { type DefaultTheme, useData } from "vitepress"
|
import { useData } from "vitepress"
|
||||||
|
import type { DefaultTheme } from "vitepress/theme"
|
||||||
import { data as release } from "../data/release.data"
|
|
||||||
|
|
||||||
import VPNavBarMenuLink from "vitepress/dist/client/theme-default/components/VPNavBarMenuLink.vue"
|
import VPNavBarMenuLink from "vitepress/dist/client/theme-default/components/VPNavBarMenuLink.vue"
|
||||||
import VPNavBarMenuGroup from "vitepress/dist/client/theme-default/components/VPNavBarMenuGroup.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>()
|
const { theme } = useData<DefaultTheme.Config>()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,7 +22,7 @@ const nav = computed(() => {
|
|||||||
|
|
||||||
const appVersion = release.stable.tag_name.substring(1)
|
const appVersion = release.stable.tag_name.substring(1)
|
||||||
|
|
||||||
return <DefaultTheme.NavItemWithChildren> {
|
return {
|
||||||
...item,
|
...item,
|
||||||
text: item.text === "{app_version}" ? appVersion : item.text,
|
text: item.text === "{app_version}" ? appVersion : item.text,
|
||||||
items: (item as DefaultTheme.NavItemWithChildren).items.map((child) => {
|
items: (item as DefaultTheme.NavItemWithChildren).items.map((child) => {
|
||||||
@ -29,12 +30,12 @@ const nav = computed(() => {
|
|||||||
return child
|
return child
|
||||||
}
|
}
|
||||||
|
|
||||||
return <DefaultTheme.NavItemWithLink> {
|
return {
|
||||||
...child,
|
...child,
|
||||||
link: child.link.replace("{app_version}", appVersion),
|
link: child.link.replace("{app_version}", appVersion),
|
||||||
}
|
} satisfies DefaultTheme.NavItemWithLink
|
||||||
}),
|
}),
|
||||||
}
|
} satisfies DefaultTheme.NavItemWithChildren
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
import { computed } from "vue"
|
import { computed } from "vue"
|
||||||
import { type DefaultTheme, useData } from "vitepress"
|
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 VPNavScreenMenuLink from "vitepress/dist/client/theme-default/components/VPNavScreenMenuLink.vue"
|
||||||
import VPNavScreenMenuGroup from "vitepress/dist/client/theme-default/components/VPNavScreenMenuGroup.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>()
|
const { theme } = useData<DefaultTheme.Config>()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,7 +21,7 @@ const nav = computed(() => {
|
|||||||
|
|
||||||
const appVersion = release.stable.tag_name.substring(1)
|
const appVersion = release.stable.tag_name.substring(1)
|
||||||
|
|
||||||
return <DefaultTheme.NavItemWithChildren> {
|
return {
|
||||||
...item,
|
...item,
|
||||||
text: item.text === "{app_version}" ? appVersion : item.text,
|
text: item.text === "{app_version}" ? appVersion : item.text,
|
||||||
items: (item as DefaultTheme.NavItemWithChildren).items.map((child) => {
|
items: (item as DefaultTheme.NavItemWithChildren).items.map((child) => {
|
||||||
@ -29,12 +29,12 @@ const nav = computed(() => {
|
|||||||
return child
|
return child
|
||||||
}
|
}
|
||||||
|
|
||||||
return <DefaultTheme.NavItemWithLink> {
|
return {
|
||||||
...child,
|
...child,
|
||||||
link: child.link.replace("{app_version}", appVersion),
|
link: child.link.replace("{app_version}", appVersion),
|
||||||
}
|
} satisfies DefaultTheme.NavItemWithLink
|
||||||
}),
|
}),
|
||||||
}
|
} satisfies DefaultTheme.NavItemWithChildren
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
@ -42,15 +42,15 @@ const nav = computed(() => {
|
|||||||
<template>
|
<template>
|
||||||
<nav v-if="nav" class="VPNavScreenMenu">
|
<nav v-if="nav" class="VPNavScreenMenu">
|
||||||
<template v-for="item in nav" :key="item.text">
|
<template v-for="item in nav" :key="item.text">
|
||||||
<VPNavScreenMenuLink
|
<VPNavScreenMenuLink
|
||||||
v-if="'link' in item"
|
v-if="'link' in item"
|
||||||
:item="item"
|
:item="item"
|
||||||
/>
|
/>
|
||||||
<VPNavScreenMenuGroup
|
<VPNavScreenMenuGroup
|
||||||
v-else
|
v-else
|
||||||
:text="item.text || ''"
|
:text="item.text || ''"
|
||||||
:items="item.items"
|
:items="item.items"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user