使用Laravel从vue-router中删除/api/

xnifntxz  于 2022-11-25  发布在  Vue.js
关注(0)|答案(1)|浏览(204)

我正在一个laravel项目中使用vue-router,但是我需要使用laravel router的api,所以我想知道当url包含/api/时,如何从vue-router传递到laravel router。我当前的web.php看起来像这样:

Route::get('/{vue_capture?}', [HomeController::class, 'index'])->where('vue_capture', '[\/\w\.-]*');
rpppsulh

rpppsulh1#

我通过将我的api路由放在vuejs路由声明之前解决了这个问题

相关问题