Skip to content

request-funjs是对$Ajax的各种请求封装成一个简洁的函数,便捷开始,提高效率,比如 Request.Get 、Request.Post、 Request.Delete Ajax request JavaScript jQuery

Notifications You must be signed in to change notification settings

CrazyMrYan/request-funjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

request-funjs

快速上手

安装

npm install request-funjs

全局注册(在main.js文件里注册)

import Request from 'request-funjs';
Vue.prototype.Request = Request;
//在这里需要声明一个 host 变量,作为请求的主机名称
Request.host = 'https://www.baidu.com'

局部注册(在你所使用的vue里注册)

import Request from 'request-funjs';
//在这里需要声明一个 host 变量,作为请求的主机名称
this.Request.host = 'https://www.baidu.com'

例子

this.Request.Get("api/list",this.params,
	res => {
	   console.log(res);
	},
	err => {
	   console.log(err);
})

目录

1、get请求 :
	Request.Get

2、post请求 :
	Request.Post

3、批量post :
	Request.PostBatch

4、put请求 :
	Request.Put

5、delete请求 
	Request.Delete

6、批量delete :
	Request.DeleteBatch

7、微信分享 :
	Request.SetShare

If you like, please give me a star ⭐

About

request-funjs是对$Ajax的各种请求封装成一个简洁的函数,便捷开始,提高效率,比如 Request.Get 、Request.Post、 Request.Delete Ajax request JavaScript jQuery

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published