vxe-ajax
v2.2.1
Published
用于 Vue 全局安装 xe-ajax
Downloads
70
Readme
vxe-ajax
用于 Vue 全局安装 xe-ajax
Installing
npm install xe-ajax vxe-ajax
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://cdn.jsdelivr.net/npm/xe-ajax"></script>
<script src="https://cdn.jsdelivr.net/npm/vxe-ajax"></script>
Example
import Vue from 'vue'
import XEAjax from 'xe-ajax'
import VXEAjax from 'vxe-ajax'
Vue.use(VXEAjax, XEAjax)
<template>
<ul>
<li v-for="item in list" :key="item.id">{{ item.name }}</li>
</ul>
</template>
<script>
export default {
data () {
return {
list: []
}
},
created () {
this.$ajax.get('/api/user/list').then(data => {
this.list = data
})
}
}
</script>
License
MIT © 2017-present, Xu Liangzhan