vue-service

1.0.3 • Public • Published

vue-service

vue-resource wrapper class

Usage

you will need to create a service class like this:

// someService.js
import Service from 'vue-service'

const apiUrl = 'http://some.stuff/api/';

export default someService extends Service {
    
    construct(){
        super(apiUrl)
    }

    getAll(){
        return this.get('someEndPoint');
    }

    getOne(id) {
        return this.get('someEndPoint/'+ id);
    }
}

then you can import it an use it in what component you like

TODO

  • Create a Service Pool Vue Plugin, in order to call Services by name within the component

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    9
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    9
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i vue-service

Weekly Downloads

9

Version

1.0.3

License

MIT

Last publish

Collaborators

  • vikkio88