Skip to content

x-extends/vxe-ajax

Repository files navigation

vxe-ajax

gitee star npm version npm build npm downloads gzip size: JS npm license

用于 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