vue3-axios请求模拟数据

还是axios - npm search

vue3-axios请求模拟数据_第1张图片

 安装axios

vue3-axios请求模拟数据_第2张图片


 

 

let {data}=await axios("http://localhost:3003/posts");其中{data}大括号对data数据进行解构

data的值如下: 

vue3-axios请求模拟数据_第3张图片

解构后的数据如下:

vue3-axios请求模拟数据_第4张图片

 

你可能感兴趣的:(vue,vue3,axios)