A
A
Analka2022-03-25 13:47:08
typescript
Analka, 2022-03-25 13:47:08

How to fix build error?

hello everyone i have a code

const route = useRoute()

const layouts = {
  'shop': NavShop,
  'sites': NavSite,
  'crm': NavCrm,
  'company': NavCompany,
}

const layout = computed(() => layouts[route.meta.menu])


throws an error when building
Type 'undefined' cannot be used as an index type.

97 const layout = computed(() => layouts[route.meta.menu])

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question