I have data props in child components. Inside child component on mounted function I need to get specific value from props and set select dropdown value. I am using vue-multiselect plugin which is working fine. Here is the code.
module.exports = {
props: ["Subscriptions"]
mounted: function () {
let vm = this;
Vue.nextTick(function () {
// I want to access props here but it return 0 length array
console.log(vm.$parent.Subscriptions);
});
},
beforeUpdate() {
let vm = this;
console.log(vm.$parent.Subscriptions);
},
// updated() {
// let vm = this;
// console.log(vm.$parent.Subscriptions);
// }
};
Now only time I do get subscriptions is in beforeUpdate and updated function but this called each time there is a change in value which is not required. I only need to change it first time in order to set drop down initial value.