Currently, I am building a multipage website using Vue and I find myself needing the same methods for different views quite often. I came across a suggestion to use a shared .js file to achieve this. It works perfectly when my "test method" downloadModel is a single function, but as soon as I try to split it up, I run into a TypeError: Cannot read properties of undefined(). How can I go about fixing this issue? I apologize for being relatively new in this world. :)
export default {
methods:{
downloadModel(id) {
this.printMessage('Download',id)
},
printMessage(string,id){
console.log(string, id)
},
} }