Vue 官方说Because setup is run around the beforeCreate and created lifecycle hooks, you do not need to explicitly define them. In other words, any code that would be written inside those hooks should be written directly in the setup function.所以axios请求应该直接写在setup 里,onMounted 是在组件渲染到页面执行的,显然不应该把axios 代码写在这里。