K
K
kr_ilya2019-05-26 20:15:34
Vue.js
kr_ilya, 2019-05-26 20:15:34

How to use value from data() of one component in another vue?

There is a component ( toolbar ) to which you need to pass a value from another component ( B ), but component B is essentially a page that is loaded when you follow the links of the router
. Here is the structure

<template>
  <v-app>
    <v-content>
        <Toolbar />

        <Drawer />

        <nuxt />
    </v-content>
  </v-app>
</template>

<script>
import Toolbar from '~/components/core/Toolbar.vue'
import Drawer from '~/components/core/Drawer.vue'

export default {
  components: {
    Toolbar,
    Drawer
  }
}
</script>

( <nuxt /> = <router-view />)
How do I get the title value that is contained in the component
index.vue (main page)
export default {
data: () => ({
title: 'Vuetify.js',
})
}

in the toolbar for further use?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2019-05-26
@kr_ilya

https://ru.vuejs.org/v2/guide/state-management.htm...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question