Hi there, I'm new to this so please forgive me if my question seems silly.
I have a vue component called vuu
/path_to_main/vue_file/app.js
const vuu = new Vue({
el: '#vuu',
data: {
latitude: 'longi',
longitude: 'lati'
},
created: function(){this.checkIfGeolocationAvailable();},
methods: {
checkIfGeolocationAvailable: function(){
getLocation(); // <-- this function
}
}
});
Now I would like to define the getLocation()
function in a separate js file, let's say
/path_to_main/vue_file/helper.js
function getLocation() {alert("Hello");}
How should I go about doing this? Or am I going about it all wrong?