0.0.12 • Published 4 years ago

vue-cli-plugin-easy-axios v0.0.12

Weekly downloads
296
License
MIT
Repository
github
Last release
4 years ago

vue-cli-plugin-easy-axios

MIT License LinkedIn

Table of Contents

About The Project

基于easier-axios封装的Vuecli插件 version: 0.0.11 lastDate: 2020/3/12 Author: Sumer Liu

Built With

Features

  1. 以axios作为基础库,easier-axios作为api管理工具对axios请求做模块化管理。
  2. 已实现axiso配置,拦截器等模板

Installatiom

 vue add easy-axios

Usage

在vue项目中的plugin中找到easier-axios.js在其中填写相应配置。

const api = new EasierAxios(
  axios,
  // config that same as axios
  {
      // baseURL: process.env.baseURL || process.env.apiUrl || ""
      // timeout: 60 * 1000, // Timeout
      // withCredentials: true, // Check cross-site Access-Control
  },
  {
      dynamicRouterPattern: `:${CONSTANT.DYNAMICROUTER_PATTERN_FLAG}` // 插件的动态路由url参数默认以:开头
  }
);

关于easier-axios中模块注册以及全局注册API移步到easier-axios

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Sumer Liu - 843627979@qq.com

Project Link: https://github.com/sumerliu/vue-cli-plugin-easy-axios