[Vuejs]-Is there any way to mount function in sidedrawer?

0👍

Ok, so you have to move the declaration of methods at the top, and than you can call feedData inside you method:

let methods = {
    onNavigationItemTap: (component) => {
        this.$navigateTo(component, {
            clearHistory: true
        });
        utils.closeDrawer();
    },
    feedData: () => {
        this.userName = appSettings.getString("user_display_name");
        this.userEmail = appSettings.getString("user_email");
    }
};

let obj = {
    mounted: () => {
        SelectedPageService.getInstance().selectedPage$
            .subscribe((selectedPage) => this.selectedPage = selectedPage);
        methods.feedData();
        alert("datta Feeded");
    },
    data: () => {
        return {
            userName: "",
            userEmail: ""
        };
    },
    methods

};

export default {
    methods,
    obj
}

Leave a comment