I am faced with a puzzle involving 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);
}
}
}
As for component B:
export default {
data() {
return {
setting: '123'
}
}
}
Each time I trigger the test method, the value returned is 123. However, when I input a new value and trigger the test method again, the value remains at 123. I am quite puzzled by this. Any help would be greatly appreciated. Thank you!