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