import Vue from "vue";
import axios from "axios";
import { apis } from "@/static/js/apis.js";
// import NoData from "@/components/NoData.vue";
let myVuePlugin = new Object();
myVuePlugin.install = function(Vue) {
/**
* 接口全局化
* */
Vue.prototype.apis = apis;
/**
* get 請(qǐng)求
* @params String url
* @params Object params
* @use this.get(url,params:{}).then(fn).catch(fn)
* */
Vue.prototype.get = axios.get;
/**
* post 請(qǐng)求
* @params String url
* @params Object params
* @use this.post(url,{}).then(fn).catch(fn)
* */
Vue.prototype.post = axios.post;
/**
* post 請(qǐng)求
* @params String url
* @params Object params
* @use this.post(url,{}).then(fn).catch(fn)
* */
Vue.prototype.changeRouter = function(path) {
this.$router.push({
path,
});
};
/**
* 全局無數(shù)據(jù)組件
* */
// Vue.component('NoData', NoData);
Vue.component('NoData', () => import("@/components/NoData.vue"));
};
Vue.use(myVuePlugin);
|