Static GitHub Issues

[280] Context support in layouts

prev: Context not being passed to data function with mixin
next: Global CSS not being included in production build

Hi!

Right now there is no context in the layouts.

I can understand why there is no context in components and it is not a problem. I can inject needed variables from pages to components via props. As described here

But how I can do it with layout?

For example I would love to do things like this:

<div v-if="isDev"> [...] </div>

or like to change some layouts component according to the http.Request etc.

Is it possible to add context to the layouts or maybe there is some workaround?

Thanks in advance,

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c238">#c238</a>)</em></sub></div>