herozhou / vue-framework-wz

👏vue后台管理框架👏
http://herozhou.coding.me/vue-framework-wz/#/dashboard
MIT License
4.33k stars 1.35k forks source link

怎么使用axios发送ajax请求 #11

Closed 451729494 closed 6 years ago

451729494 commented 6 years ago

现在前端已经可以独立跑起来了,我看了源码,你对axios进行了一层封装,怎么才能调用到你封装的axios实现请求后台

herozhou commented 6 years ago

可以直接使用jQuery的$.post发送请求,如果使用axios,可以去看下文档 https://github.com/axios/axios

usering1995 commented 5 years ago

@/utils/fetch可以调用吗?

wuquaner commented 5 years ago

需要先安装axios才能使用 安装axios: npm install axios --save

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

usering1995 commented 5 years ago

下了 @/utils/fetch @/utils/http 是不是都得引入

wuquaner commented 5 years ago

@/utils/fetch @/utils/http在main,js里面引入就可以了,你看一下,有的可能是在里面进行了二次封装 src/utils下的公用方法调用 例如:你写了一个 util.number=funtion(){}方法,在.vue里面引入util.js,然后调用方法的时候写成util.number(你的值)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.