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();