In my data object, there is a small section dedicated to creating a navigation menu. This menu contains buttons that should trigger specific functions. I decided to store these functions within the data object for clarity.
However, the issue arises when this
does not return a Vue object. Despite attempting to incorporate the vm into the global scope, I am struggling to find an alternative solution.
Any thoughts or suggestions on how to approach this?
const data = {
login: {
title: "Log in",
icon: "fa fa-sign-in",
action: function () {
console.log("Log in");
// Here is where I aim to access the vm, possibly like this:
// this.$root.showLoginBox();
}
}
}