Skip to content

microservice-framework/vue-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-api-client

Vue.$api that is capable to be watched and provide wrapper to access MFW API

usage

import APICLient from "@microservice-framework/vue-api-client";

// Init global this.$state variable
Vue.use(APICLient, {
  apiURL: "https://api.myserver.com",
  methods: [
    {
      name: "printSelf",
      function: function () {
        console.log(this);
      },
    }
  ]
});

....


this.$api.setAccessToken({
        accessToken: "APIAccessToken",
        expireAt: -1,
      });

...

watch: {
  '$api.online': function(newValue) {
    if(newValue) {
      //fetch data from API
    }
  }
}

About

Vue3 $api.client function to simplify access and init $api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published