Comparing version 1.4.1 to 1.4.2
/** | ||
* vxe-ajax.js v1.4.1 | ||
* vxe-ajax.js v1.4.2 | ||
* (c) 2017-2018 Xu Liangzhan | ||
@@ -4,0 +4,0 @@ * ISC License. |
/** | ||
* vxe-ajax.js v1.4.1 | ||
* vxe-ajax.js v1.4.2 | ||
* (c) 2017-2018 Xu Liangzhan | ||
@@ -4,0 +4,0 @@ * ISC License. |
@@ -0,1 +1,4 @@ | ||
import Vue from 'vue' | ||
import { XEAjaxMethods } from 'xe-ajax' | ||
/** | ||
@@ -10,2 +13,8 @@ * 用于 Vue 全局安装 xe-ajax | ||
declare module 'vue/types/vue' { | ||
interface Vue { | ||
$ajax: XEAjaxMethods | ||
} | ||
} | ||
export default VXEAjax; |
{ | ||
"name": "vxe-ajax", | ||
"version": "1.4.1", | ||
"description": "用于 Vue 全局安装 xe-ajax", | ||
"version": "1.4.2", | ||
"description": "A small wrapper for integrating xe-ajax to Vuejs.", | ||
"main": "index.js", | ||
"typing": "index.d.ts", | ||
"scripts": { | ||
@@ -28,3 +29,7 @@ "test": "make test" | ||
}, | ||
"homepage": "https://github.com/xuliangzhan/vxe-ajax#readme" | ||
"homepage": "https://github.com/xuliangzhan/vxe-ajax#readme", | ||
"devDependencies": { | ||
"vue": "^2.5.16", | ||
"xe-ajax": "^3.4.12" | ||
} | ||
} |
@@ -41,39 +41,10 @@ # 用于 Vue 全局安装 xe-ajax | ||
## 示例 | ||
## 使用 | ||
./Home.vue | ||
```HTML | ||
<template> | ||
<div> | ||
<ul> | ||
<li v-for="(item, index) in list" :key="index">{{ item.name }}</li> | ||
</ul> | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
data () { | ||
return { | ||
loading: false, | ||
list: [] | ||
} | ||
}, | ||
created () { | ||
this.init() | ||
}, | ||
methods: { | ||
init () { | ||
this.loading = true | ||
this.$ajax.getJSON('/api/user/list').then(data => { | ||
this.loading = false | ||
this.list = data | ||
}).catch(e => { | ||
this.loading = false | ||
}) | ||
} | ||
} | ||
} | ||
</script> | ||
```JavaScript | ||
this.$ajax.fetch('/api/user/list').then(response => { | ||
response.json().then(data => { | ||
console.log(data) | ||
}) | ||
}) | ||
``` | ||
@@ -80,0 +51,0 @@ |
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
112
7810
2
53