From the course: Building Laravel and Vue.js 2 Web Apps
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Enabling Vue Router history mode
From the course: Building Laravel and Vue.js 2 Web Apps
Enabling Vue Router history mode
- [Instructor] In this video, we'll enable Vue Router's history mode for cleaner URLs and we'll also build out our menu item form for adding new items to a category. If you want more SEO friendly URLs, or if you just prefer not to use this hash base routing, you can remove it easily and enable Vue Router's history mode by setting the mode option to history. In our case, we'll also want to change this slash path to menu editor since routing will be based on the actual URL now. So now when I go back to the browser and navigate to menu editor, we're redirected to just/categories. And I can click add item now and the URL's just/additem. So I can click back and forth and use these nice URLs and I'm always in the router on the menu editor page. But this will create a conflict with our original categories page. From inside our menu editor, Vue Router can intercept requests for /categories in router links but if we go up to the address bar and navigate to /categories directly if I hit enter…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Protecting admin pages with gates4m 30s
-
(Locked)
Installing and configuring Vue Router4m 56s
-
(Locked)
Using props and router-link4m 50s
-
(Locked)
Enabling Vue Router history mode5m 38s
-
(Locked)
Validating form submissions5m 23s
-
(Locked)
Displaying model validation errors5m 43s
-
(Locked)
Managing file uploads6m 50s
-
(Locked)
Working with related models4m 39s
-
(Locked)
Building a list view with detail links6m 4s
-
(Locked)
Reusing form components3m 56s
-
(Locked)
Using Laravel form requests3m 48s
-
(Locked)
Using Vue Router navigation guards3m 37s
-
-
-