Comparing version 1.0.12 to 1.0.16
{ | ||
"name": "vxe-ajax", | ||
"version": "1.0.12", | ||
"version": "1.0.16", | ||
"description": "VXEAjax 用于Vue全局安装xe-ajax", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,11 +18,31 @@ # VXEAjax 用于Vue全局安装xe-ajax | ||
// 通过vue实例的调用方式 | ||
this.$ajax.getJSON ('url', {id: 1}) | ||
.then(data => { | ||
// data | ||
}).catch(data => { | ||
// data | ||
}) | ||
this.$ajax.doGet('services/user/list', {id: 1}) | ||
this.$ajax.getJSON ('services/user/list', {id: 1}) | ||
this.$ajax.doPost ('services/user/save', {id: 1}) | ||
this.$ajax.postJSON ('services/user/save', {id: 1}) | ||
``` | ||
### 混合函数 | ||
#### 文件 ./customs.js | ||
``` shell | ||
export function custom1 () { | ||
console.log('自定义的函数') | ||
} | ||
``` | ||
#### 示例 | ||
``` shell | ||
import Vue from 'vue' | ||
import XEAjax from 'xe-ajax' | ||
import VXEAjax from 'vxe-ajax' | ||
import customs from './customs' | ||
XEAjax.mixin(customs) | ||
Vue.use(VXEAjax, XEAjax) | ||
// 调用自定义扩展函数 | ||
this.$ajax.custom1() | ||
``` | ||
## License | ||
Copyright (c) 2017-present, Xu Liangzhan |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2866
47