Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

coolpraz's avatar

Spark: Can't get the base mixins value

i want to get the base mixins props value in a component


var base = require('navbar/navbar');

Vue.component('spark-navbar', {
    mixins: [base],

    mounted() {
        console.log(this.unreadNotificationsCount);
    },
});

i get the value 0 where in vue dev tools the value is unreadNotificationsCount is 1

0 likes
1 reply
coolpraz's avatar
coolpraz
OP
Best Answer
Level 32

i figured out myself, its because the mounted call when vue is loaded but the problem is its inline template and data is passed through props so we must use updated() instead of mount(), updated() is called after inline view template is render

var base = require('navbar/navbar');

Vue.component('spark-navbar', {
    mixins: [base],

    updated() {
        console.log(this.notificationsCount);
    },
});
1 like

Please or to participate in this conversation.