Answer the question
In order to leave comments, you need to log in
Is it possible to use vue router on a multipage (NOT spa) site in laravel?
Hello, is it possible to somehow use vue router on a multi-page (NOT spa) site on laravel?
Those. for example, on the /admin/categories page, the template of which is generated by laravel, I hook app.js
//app.js
new Vue({
router,
mounted() {
console.log(this.$route.path) // "/"
}
});
//router.js
const AdminCategories = () => import('./components/admin/categories.vue')
routes: [
{path: '/admin/categories', component: AdminCategories},
]
Answer the question
In order to leave comments, you need to log in
Something you are not doing. On laravel, all requests should go to one file, in which vue is drawn.
Then a regular vue project with routing.
Or you can combine the classics with vue. Ordinary blade pages with their own vue components.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question