匠艺良材后台api接口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
823 B

  1. const VueAxios = {
  2. vm: {},
  3. // eslint-disable-next-line no-unused-vars
  4. install(Vue, router = {}, instance) {
  5. if (this.installed) {
  6. return;
  7. }
  8. this.installed = true;
  9. if (!instance) {
  10. // eslint-disable-next-line no-console
  11. console.error('You have to install axios');
  12. return;
  13. }
  14. Vue.axios = instance;
  15. Object.defineProperties(Vue.prototype, {
  16. axios: {
  17. get: function get() {
  18. return instance;
  19. }
  20. },
  21. $http: {
  22. get: function get() {
  23. return instance;
  24. }
  25. }
  26. });
  27. }
  28. };
  29. export {
  30. VueAxios,
  31. // eslint-disable-next-line no-undef
  32. //instance as axios
  33. }