I have make a project in laravel with vue js my issue first i have set in route mode history beacause i want to remove # tag then after i have change route using vue js so remove url below see image:
first load home component see in image above url:
when i click a about link remove before component name project name from url :
same as in contact component :
app.js
`
import Vue from 'vue';
import Vuerouter from 'vue-router'
require('./bootstrap');
window.Vue = require('vue');
Vue.use(Vuerouter);
import App from './../../views/App.vue'
import routes from './router/routes';
const router = new Vuerouter({
mode: 'history',
routes:routes
});
new Vue({
el: '#app',
router,
components: { App },
});
`
routes.js
`import home from './../components/home.vue';
import about from './../components/about.vue';
import contact from './../components/contact.vue';
I have make a project in laravel with vue js my issue first i have set in route mode history beacause i want to remove # tag then after i have change route using vue js so remove url below see image:
first load home component see in image above url:
when i click a about link remove before component name project name from url :
same as in contact component :
` import Vue from 'vue'; import Vuerouter from 'vue-router' require('./bootstrap');
window.Vue = require('vue'); Vue.use(Vuerouter);
import App from './../../views/App.vue'
import routes from './router/routes';
const router = new Vuerouter({ mode: 'history', routes:routes
});
new Vue({ el: '#app', router, components: { App }, });
`
routes.js
`import home from './../components/home.vue'; import about from './../components/about.vue'; import contact from './../components/contact.vue';
const routes = [ { path : '/',name : 'home',component : home }, { path : '/about',name : 'about',component : about }, { path : '/contact', name : 'contact', component : contact } ]
export default routes`