E
E
Eugene2021-11-16 21:33:45
Vue.js
Eugene, 2021-11-16 21:33:45

How to access the root template from a component in NUXT?

Ask such a question.
When working with pure vue, I kept some things in the main app component (localization file, general loadable system settings, some methods that I use often and everywhere) and accessed them from internal components via this.$root.... .
Immediately in Nuxt, the $root component is completely different, its own in Nuxt.

Tell me how to correctly contact the root of my layout where everything is stored.
Or maybe I'm not doing it correctly at all what I store some data and methods in the root component. There is some other and correct way. Point me right :)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Aetae, 2021-11-16
@Aetae

export, import?
Provide, Inject?

N
no_one_safe, 2021-11-17
@no_one_safe

Use vuex to store global information

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question