Static GitHub Issues

[647] How to pass data to layout from index.vue?

prev: Importing file in style increases build time drasticaly
next: Routes with one required and one optional parameter (id + slug)

i have in layout/main.vue:

...
<navbar :somedata="somedata"/>
<nuxt/>
...
import navbar from '~components/navbar.vue';
...

I want to send to navbar data from the index.vue:

data() {
    return: {
        somedata: 'sometext'
    }
}

and in components/navbar.vue:

props: ['somedata']

but i get: [Vue warn]: Property or method "somedata" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option. How to do?

<!--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/c564">#c564</a>)</em></sub></div>