How to access App.vue from another component?
问题 in my app written with VueJs 2, I have into the Vue.app this code: export default { name: 'app', data () { return { title: 'Gestione fornitori', idfornitore: '' } }, methods: { loadFunction (route) { this.$router.push(route) } } } </script> I wish to access the property idfornitore from another component, I've used: mounted () { this.$parent.idfornitore = '' }, or also: mounted () { var Vue = require('vue') Vue.app.idfornitore = '' }, But it didn't worked. Which is the correct way to access