In my Vue page, I have a script that opens a child window using the code snippet below:
this.presentation = window.open(
this.$router.resolve({name:'presentation'}).href,
'child window',
'width=auto,height=auto'
);
The above code works perfectly fine, but now I need to access and call its methods. I attempted to access them like this:
Parent:
this.presentation.setPage(0);
Child component:
export default {
name: 'Presentation',
data() {
return {
page: null
}
},
methods: {
setPage(_page) {
this.page = _page;
}
}
However, when I try to call the child method, I encounter the following error message:
TypeError: "this.presentation.setPage is not a function"
Why am I unable to call the child's methods? How can I resolve this issue?