Axiosの基本的な使用法

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)
      })
    })
  },

おすすめ

転載: blog.csdn.net/weixin_42645716/article/details/112791640