docs: types (#2186)

This commit is contained in:
Romain Hamel
2024-09-12 11:10:23 +02:00
committed by GitHub
parent 26e5ac80b6
commit 523493105e
19 changed files with 54 additions and 47 deletions

View File

@@ -5,11 +5,12 @@ import * as theme from '#build/ui'
const route = useRoute()
const name = camelCase(route.params.slug[route.params.slug.length - 1])
const slug = Array.isArray(route.params.slug) ? route.params.slug[0] ?? '' : route.params.slug ?? ''
const name = camelCase(slug[slug.length - 1] ?? '')
const strippedCompoundVariants = ref(false)
function stripCompoundVariants(component) {
function stripCompoundVariants(component: any) {
if (component.compoundVariants) {
component.compoundVariants = component.compoundVariants.filter((compoundVariant: any) => {
if (compoundVariant.color) {
@@ -38,7 +39,7 @@ function stripCompoundVariants(component) {
const component = computed(() => {
return {
ui: {
[name]: stripCompoundVariants(theme[name])
[name]: stripCompoundVariants((theme as any)[name])
}
}
})