I'd like to use the vue-resource $http methods within the script tag of my vueify component but I always get this error:
Uncaught TypeError: Cannot read property 'get' of undefined
My guess would be that the "this" keyword doesn't work (wouldn't know why) or the module isn't installed correctly (although it should be, checked that). My vue-component looks like this:
<template>
<!-- just displaying the data -->
</template>
<script>
module.exports = {
data: function () {
return {
foo: "bar"
}
},
ready: function() {
// the error occurs on the next line
this.$http.get('/api/users', function(data){
this.$set('users', data);
});
}
}
</script>