var searchParams={ pageIndex=1, pageSize=10, status:[1,3] } searchParams.status = searchParams.status.toString(); //把数组转为字符串 this.$axios.get( "/getTableData", {params:searchParams}, ) .then(res=>{ console.log(res); }) .catch(err=>{console.log("err")})
//所形成的url为:/getTableData?status=1,3等价于 /getUserByName?status=1&status=3
参考网址:https://blog.csdn.net/Cribug8080/article/details/88343758