I'm facing a challenge while attempting to globally set a property using Vue.prototype
.
This is what I currently have:
microsoftTeams.initialize();
microsoftTeams.getContext((context) => {
Vue.prototype.$teamsContext = true;
});
new Vue({
el: '#overview',
components: {
Index
},
data: {
// add attributes here
},
});
It seems like the issue lies in not being able to access Vue.prototype
within the getContext
call since $teamsContext
is never initialized.
Is there a workaround for this situation?
Thank you
EDIT::
I've added some additional code.
Within the created()
method of the Index
component, I have a
console.log("CONTEXT", this.$teamsContext)
, which outputs CONTEXT undefined