sudhanshugargG
1 month ago
156
2
General

Laravel vue route issue

Posted 1 month ago by sudhanshugargG

Hi,

I am using vuejs route in my laravel app.

Here's what I have defined in the app.js file.

import VueRouter from 'vue-router'
Vue.use(VueRouter)

// Defining the routes
const routes = [
    { path: '/scholarships', component: require('./components/admin/Scholarships.vue').default },
    { path: '/scholarship/add', component: require('./components/admin/ScholarshipAdd.vue').default }
]

// Create the router instance and pass the `routes` option
const router = new VueRouter({
    mode: 'history',
    routes // short for `routes: routes`
})

Now, when I visit to the /scholarships link, it fetch data from the laravel api perfectly. Even when I click on /scholarship/add that render the add new form without any issue.

But from /scholarship/add url, if I click on /scholarships, it doesn't show any data.

Any tips how to solve that?

Please sign in or create an account to participate in this conversation.