proxyTable: {
            '/api': {
                target: 'http://localhost:8080',
                pathRewrite: {
                    '^/api': '/static/mock'
                }
            }
        },
  methods: {
    getHomeInfo() {
      axios.get("/api/index.json").then(this.getHomeInfoSucc); //
    },
    getHomeInfoSucc(res) {
      console.log(res);
    }
  },

vue 本地模拟数据路径替换

相关文章:

  • 2021-10-26
  • 2022-12-23
  • 2021-10-17
  • 2021-12-06
  • 2021-10-19
  • 2021-05-02
  • 2021-08-11
  • 2021-11-13
猜你喜欢
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2021-10-16
  • 2022-12-23
相关资源
相似解决方案