@iankibetsh/vue-streamline
v1.1.6
Published
Vue library for streamlining laravel backend services with @iankibet/streamline composer package
Downloads
208
Readme
vue-streamline
Vue library for streamlining laravel backend services with @iankibet/streamline composer package
Installation
npm install @iankibetsh/vue-streamline
Usage
In your main.js file, import the library and register it as a plugin:
import {streamline} from '@iankibetsh/vue-streamline'
Vue.use(streamline, {
streamlineHeaders: {
// Add any headers you want to send with the request
},
streamlineUrl: 'http://localhost:8000/api/streamline' // The url to the streamline route
})
usage in vue component
import { useStreamline } from '@iankibet/vue-streamline'
const {getActionUrl, service:tasksService} = useStreamline('tasks')
// call the service methods
tasksServices.getTasks().then(response => {
console.log(response)
})
Getting url to an action/method in the service
You can get the url to an action/method in the service by calling the getActionUrl method on the service object passing the action name and any parameters
getActionUrl('getTasks', 'active')