Skip to content

Commit

Permalink
docs: fix refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Sep 12, 2024
1 parent 5076b8c commit ad77a0e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions docs/app/components/content/ComponentCode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ const props = defineProps<{
const route = useRoute()
const { $prettier } = useNuxtApp()

const slug = Array.isArray(route.params.slug) ? route.params.slug[0] ?? '' : route.params.slug ?? ''
const camelName = camelCase(slug[slug.length - 1] ?? '')
const camelName = camelCase(route.params.slug?.[route.params.slug.length - 1] ?? '')
const name = `U${upperFirst(camelName)}`

const componentProps = reactive({ ...(props.props || {}) })
Expand Down
3 changes: 1 addition & 2 deletions docs/app/components/content/ComponentEmits.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { upperFirst, camelCase } from 'scule'
const route = useRoute()
const slug = Array.isArray(route.params.slug) ? route.params.slug[0] ?? '' : route.params.slug ?? ''
const camelName = camelCase(slug[slug.length - 1] ?? '')
const camelName = camelCase(route.params.slug?.[route.params.slug.length - 1] ?? '')
const name = `U${upperFirst(camelName)}`
const meta = await fetchComponentMeta(name as any)
Expand Down
3 changes: 1 addition & 2 deletions docs/app/components/content/ComponentProps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ const props = defineProps<{
const route = useRoute()
const slug = Array.isArray(route.params.slug) ? route.params.slug[0] ?? '' : route.params.slug ?? ''
const camelName = camelCase(slug[slug.length - 1] ?? '')
const camelName = camelCase(route.params.slug?.[route.params.slug.length - 1] ?? '')
const name = `U${upperFirst(camelName)}`
const componentTheme = (theme as any)[camelName]
Expand Down
3 changes: 1 addition & 2 deletions docs/app/components/content/ComponentSlots.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { upperFirst, camelCase } from 'scule'
const route = useRoute()
const slug = Array.isArray(route.params.slug) ? route.params.slug[0] ?? '' : route.params.slug ?? ''
const camelName = camelCase(slug[slug.length - 1] ?? '')
const camelName = camelCase(route.params.slug?.[route.params.slug.length - 1] ?? '')
const name = `U${upperFirst(camelName)}`
const meta = await fetchComponentMeta(name as any)
Expand Down
3 changes: 1 addition & 2 deletions docs/app/components/content/ComponentTheme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import * as theme from '#build/ui'
const route = useRoute()
const slug = Array.isArray(route.params.slug) ? route.params.slug[0] ?? '' : route.params.slug ?? ''
const name = camelCase(slug[slug.length - 1] ?? '')
const name = camelCase(route.params.slug?.[route.params.slug.length - 1] ?? '')
const strippedCompoundVariants = ref(false)
Expand Down

0 comments on commit ad77a0e

Please sign in to comment.