Hello there: quick question I've
target: 'server' in the nuxt.config.js/person/maxime will give me template: PersonsSingle )_pages/person.vue )How can I handle this at runtime ? I guess it's something to do with the middlewares but which one and what is the best strategy here ?
PS: I use this system because two urls with the same structure (eg: /person/maxime and /person/sam could lead to two completely different templates ). Don't ask why I have to deal with it :/
This is how I would do it.
async asyncData({ $axios }) {
const data = await $axios.$get('...')
const templateType = data.templateType
return {
templateType
}
}
<template>
<div>
<page-1 v-if="templateType === 'foo'" />
<page-2 v-else />
</div>
</template>