vue

您所在的位置:网站首页 VUE官网下载 vue

vue

2024-07-16 10:12| 来源: 网络整理| 查看: 265

本站由axios爱好者共建,部署在vultr vps上,推荐使用vultr!价格实惠,实力雄厚。 最近新注册用户充值$25,可额外获赠$50,搭建博客必备。 前往注册

udemy web开发课程,涵盖angular、vue和react,共17门,几十G课程网盘观看 前往领取

vue-axios

基于vuejs 的轻度封装npm versioninstall sizenpm downloads

code helpers

安装:CommonJS:npm install --save axios vue-axios

将下面代码加入入口文件:import Vue from 'vue'import axios from 'axios'import VueAxios from 'vue-axios'Vue.use(VueAxios, axios)

Script:

按照这个顺序分别引入这三个文件: vue, axios and vue-axios

Usage:

This wrapper bind axios to Vue or this if you’re using single file component.

你可以按照以下方式使用:Vue.axios.get(api).then((response) => { console.log(response.data)})this.axios.get(api).then((response) => { console.log(response.data)})this.$http.get(api).then((response) => { console.log(response.data)})



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3