I have 2 components: A and B.
Component A:
import B from '../components/B.vue';
export default {
components: {
B
},
methods: {
test: function() {
console.log(B.data().settings);
}
}
}
And component B:
export default {
data() {
return {
setting: '123'
}
}
}
When I trigger test method then I get the value is 123. But when I enter new value from an input and trigger test method again I can't get the new value, the value is still 123.
I have no idea about this. Thank you so much !!!.