0👍
Well, as far I can see, your approach was good. You are capturing all GET requests, and passing them to your Blade view.
My suggestion:
- Cleaner route:
Route::get('/{any}', 'YourController@index')->where('any', '.*');
Your app.js (main JS file should look something like this):
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
import App from './views/App'
import About from './views/About'
import Home from './views/Home'
const router = new VueRouter({
mode: 'history',
routes: [
{
path: '/',
name: 'home',
component: Home
},
{
path: '/about',
name: 'about',
component: About,
},
],
});
const app = new Vue({
el: '#app',
components: { App },
router,
});
With all this configuration and your router-view
, you should be fine.
- [Vuejs]-Laravel & Vue: Initialise Authentication from Store before rendering any components using
- [Vuejs]-How can I change textfields layout in the vuetify?
Source:stackexchange.com