https://github.com/hsiangleev/vue-ajax
https://github.com/hsiangleev/vue-ajax
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/hsiangleev/vue-ajax
- Owner: hsiangleev
- Created: 2017-09-17T08:17:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-07T01:28:58.000Z (over 8 years ago)
- Last Synced: 2025-03-26T04:04:59.216Z (over 1 year ago)
- Language: JavaScript
- Size: 69.3 KB
- Stars: 2
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vue-ajax
### 我自己封装的vue-ajax插件
### 使用方法:
> * 引入文件
> * new Vue().ajax.get(url,data,fn,ojson), 或 new Vue().ajax.post(url,data,fn,ojson)
> * url: 需要获取数据的文件地址 (string)
> * data: 需要发送的信息 (可省略) (obj)
> * fn: 获取信息后的回调函数,接收到的返回值为data (function)
> * ojson: 是否需要转换为json格式 (可省略) (设置为 "json")
> * new Vue().ajax.get().cancel(): 取消异步请求
> * new Vue().ajax.json(str): 可转化json格式字符串