Comparing version 1.3.0 to 1.3.2
/*! | ||
* vxe-ajax.js v1.3.0 | ||
* vxe-ajax.js v1.3.2 | ||
* (c) 2017-2018 Xu Liangzhan | ||
@@ -4,0 +4,0 @@ * ISC License. |
/*! | ||
* vxe-ajax.js v1.3.0 | ||
* vxe-ajax.js v1.3.2 | ||
* (c) 2017-2018 Xu Liangzhan | ||
@@ -4,0 +4,0 @@ * ISC License. |
{ | ||
"name": "vxe-ajax", | ||
"version": "1.3.0", | ||
"version": "1.3.2", | ||
"description": "VXEAjax 用于Vue全局安装 xe-ajax", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# VXEAjax 用于Vue全局安装 xe-ajax | ||
安装完成后自动挂载在vue实例 this.$ajax(XHR请求函数) | ||
安装完成后自动挂载在vue实例 this.$ajax | ||
@@ -15,3 +15,3 @@ ### 直接引用 script 全局安装,VXEAjax 会定义为全局变量 | ||
// ...vue代码省略 | ||
this.$ajax.doGet('services/user/list', {id: 1}) | ||
this.$ajax.getJSON('/api/user/list', {id: 1}) | ||
``` | ||
@@ -39,3 +39,3 @@ | ||
// ...vue代码省略 | ||
this.$ajax.doGet('services/user/list', {id: 1}) | ||
this.$ajax.getJSON('/api/user/list', {id: 1}) | ||
}) | ||
@@ -58,6 +58,4 @@ ``` | ||
// 通过vue实例的调用方式 | ||
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}) | ||
this.$ajax.getJSON ('/api/user/list', {id: 1}) | ||
this.$ajax.postJSON ('/api/user/save', {id: 1}) | ||
``` | ||
@@ -68,3 +66,3 @@ | ||
``` shell | ||
export function custom1 () { | ||
export function get1 () { | ||
console.log('自定义的函数') | ||
@@ -78,3 +76,2 @@ } | ||
import VXEAjax from 'vxe-ajax' | ||
import customs from './customs' | ||
@@ -86,3 +83,3 @@ | ||
// 调用自定义扩展函数 | ||
this.$ajax.custom1() | ||
this.$ajax.get1() | ||
``` | ||
@@ -110,4 +107,3 @@ | ||
init () { | ||
this.$ajax.getJSON('services/user/list', {id: 123}) | ||
.then(data => { | ||
this.$ajax.getJSON('/api/user/list', {id: 123}).then(data => { | ||
this.list = data | ||
@@ -114,0 +110,0 @@ }).catch(data => { |
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
5081
116