Skip to content

Instantly share code, notes, and snippets.

@InfoSec812
Created October 20, 2018 03:17
Show Gist options
  • Select an option

  • Save InfoSec812/5b96c694b3ebcb6a73c613c809550cff to your computer and use it in GitHub Desktop.

Select an option

Save InfoSec812/5b96c694b3ebcb6a73c613c809550cff to your computer and use it in GitHub Desktop.
Add a REST library as a global property on the Vue object
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import "./registerServiceWorker";
import "./styles/quasar.styl";
import "quasar-framework/dist/quasar.ie.polyfills";
import iconSet from "quasar-framework/icons/fontawesome";
import "quasar-extras/fontawesome";
import Quasar from "quasar";
// Just pretend we imported an API client or Axios or something
const myApiClient = {};
// Assign our API client to the Vue class as $api
Vue.prototype.$api = myApiClient;
Vue.use(Quasar, {
config: {},
iconSet: iconSet
});
Vue.config.productionTip = false;
new Vue({
router,
render: h => h(App)
}).$mount("#app");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment