报错
<p><strong>inject() can only be used inside setup() or functional components.</strong></p>
<p>vue3中useRouter,useStore要放在setup中引入,我们在封装axios文件中不能直接引入</p>
<pre><code class="language-javascript">import { useRouter } from &quot;vue-router&quot;
const router = useRouter()
// 改为
import router from '@/router'</code></pre>