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 the property from another component?
Thank you in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…