Axios basic usage

1. Installation

npm install --save axios

Screenshot of installation completion (if there is an error, see the
Insert picture description here
previous article) 2. Configure in main.js

Insert picture description here
3. Use
Insert picture description here

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

Guess you like

Origin blog.csdn.net/weixin_42645716/article/details/112791640