zl程序教程

您现在的位置是:首页 >  其他

当前栏目

axios 基础用法

基础 用法 Axios
2023-09-11 14:19:17 时间

1.安装

npm install --save axios

安装完成截图(如果出现报错,看上一篇文章)
在这里插入图片描述
2.在main.js中配置

在这里插入图片描述
3.使用
在这里插入图片描述

created () {
    this.$axios.get("http://localhost:8080/static/js/data.json").then((response) => {
      this.$nextTick(() => {
        console.log(response)
      })
    })
  },