axios get request to pass parameters es6 grammar

When the rear end of the interface need to pass the url variables, the following interfaces, variables for incoming and sn clientId
/client/find/{clientId}/{sn}

Use es6 syntax anti quotes and $ symbol stitching

Solutions are as follows

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

Guess you like

Origin www.cnblogs.com/lijianshen/p/12092047.html