vue-axios
Version:
A small wrapper for integrating axios to Vuejs
1 lines • 1.18 kB
JavaScript
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,o){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e="undefined"!=typeof globalThis?globalThis:e||self).VueAxios=o()}(this,function(){"use strict";function n(e,o){if(!n.installed)if(o){if(n.installed=!0,e.version&&e.version.split(".")[0]<3)Object.defineProperties(e.prototype,{axios:{get:function(){return o}},$http:{get:function(){return o}}});else{if(!(e.version&&3<=e.version.split(".")[0]))return void console.error("Unknown Vue version");e.config.globalProperties.axios=o,e.config.globalProperties.$http=o}e.axios=o,e.$http=o}else console.error("You have to install axios")}return"object"==("undefined"==typeof exports?"undefined":_typeof(exports))?module.exports=n:"function"==typeof define&&define.amd?define([],function(){return n}):window.Vue&&window.axios&&window.Vue.use&&Vue.use(n,window.axios),n});