I am querying non-slice data using:
const page = await $prismic.api.getByUID('page', uid, {
lang: 'en-gb'
})
which seems to work, however, I cannot see any options for slice zone to include the language. In my nuxt.config.js:
apiOptions: {
routes: [
{
type: 'page',
path: '/:lang/:uid'
}
]
}
My folder structure is /_lang/_slug.vue
including an index for the lang and an index.vue
in the root of pages
.
SliceZone:
<SliceZone type="page" :uid="$route.name" />
Edit: It seems to work when I pass through the uid I get from page.uid
, but not for the index page. It seems to retrieve the master language on the index page, even if I am using en-gb
(not the master language).
I tried to input them as strings using index
but because both the master language and en-gb
have index
it seems to use the master language. Interesting when I add a number
, e.g. index1
the slice does not recognise, but the regular asyncData
does.
Sorted. Use the slices prop:
<SliceZone type="page" uid="homepage" :slices="page.data.body" />
Any idea?
Cheers