vue中安装axios
生活随笔
收集整理的這篇文章主要介紹了
vue中安装axios
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1、在項目根目錄下輸入如下:
$ npm install --save axios2、在main.js或者需要用到ajax的頁面中將它導入
import axios from 'axios';3、在main.js中定義全局變量
Vue.prototype.$post = post; Vue.prototype.$get = get;總結
以上是生活随笔為你收集整理的vue中安装axios的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: matlab 对数函数表示,matlab
- 下一篇: html5倒计时秒杀怎么做,vue 设