当后端接口url中需要传入变量时,如下接口,clientId和sn为传入变量
/client/find/{clientId}/{sn}

使用es6的语法反引号和$符号拼接

解决方法如下

let client = haha
let sn = succe
this.$axios.get(`/client/find/${clientId}/${sn}`)
.then(res => {
  console.log(res)      
}

相关文章:

  • 2021-11-23
  • 2022-12-23
  • 2021-12-09
  • 2021-12-27
  • 2021-12-05
  • 2022-12-23
猜你喜欢
  • 2023-03-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案