I have vue2 component where I want to access a data object variable to use in template. Pertinent code: Template:
<div v-html="theWivesBios[currentWife]" class="modal-content"></div>
Script:
export default {
name: "theSixWives",
data() {
return {
theWivesBios: theWivesBios,
currentWife: ""
};
},
mounted() {
elContainer.addEventListener("click", function(ev) {
//Want to manipulate this.currentWife in callback
this.currentWife = "testing"; // this.currentWife isnt available to vue instance
}
What would be best way to "hoist" this.currentWife so the vue instance would have access to it for use in my template?