TypeError: Cannot read property '$http' of undefined
问题 Trying to use vue-resource but i am etting the error described in the title. The code below is in utils section called network.js : import VueResource from 'vue-resource' const getConfig = () =>{ console.log('its working'); // GET /someUrl this.$http.get('https://fdsdfsdf-685a-45ed-8665-9847e0dbce0d.mock.pstmn.io/getConfig') .then(response => { // get body data this.config = response.body; }, response => { // error callback }); }; //Export login so other classes can use it export{ getConfig }