Build requests for REST API easily with Vue API Query
Vue API Query is a package that helps you quickly to build requests for REST API, and keep your code clean and elegant.
Installation
yarn add vue-api-query
Basic usage
// GET /posts?filter[status]=ACTIVE&include=user,category&append=likes&orderBy=-created_at,category_id
let posts = await Post
.where('status', 'ACTIVE')
.include('user', 'category')
.append('likes')
.orderBy('-created_at', 'category_id')
.get()
Link:
This post is submitted by our members. Submit a new post.
Topics: Javascript VueJS VueJS 2
Tags: Tutorials