Vue.js: define a service

You can export the instance of a class for your service:

export default new class {
   ...
}

In your component, or any other place, you can import the instance and you will always get the same one. This way it behaves similar to an injected Angular service, but without using this.

import myService from '../services/myservice';

Vue.component('my-component', {
  ...
  created: function() {
    myService.oneFunction();
  }
  ...
})

From the Vue.js documentation.

Vue.js itself is not a full-blown framework - it is focused on the view layer only.

As a library focusing on the V out of MVC it does not provide things like services.

Are you using some kind of module loader like Browserify or Webpack?
Then you can leverage the module system of ES6 to create a service all by yourself.
All you have to do is to create a plain JavaScript class which is being exported by this new module.

An example could look like this:

export default class RestResource {

  sendRequest() {
    // Use vue-resource or any other http library to send your request
  }

}

Inside your vue component 1 and 2 you can use this service by importing the class.

import RestResource from './services/RestResource';

const restResourceService = new RestResource();

restResourceService.sendRequest();