Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

The content of children component is not updated #21

Open
phuclh opened this issue Apr 18, 2019 · 1 comment
Open

The content of children component is not updated #21

phuclh opened this issue Apr 18, 2019 · 1 comment

Comments

@phuclh
Copy link

phuclh commented Apr 18, 2019

I installed the package and setup like below. The problem is when I visit children components, the breadcrumbs was showed up right, but the content of that child component didn't get change. For example, when I entered the cart page it didn't show up the content of CartPage component and still keeps content from HomePage component.

router/routes.js

export default [
    {
        name: 'home',
        path: '/',
        component: HomePage,
        meta: {
            breadcrumb: 'Homepage',
        },
        children: [
            {
                name: 'product',
                path: '/products/:id/:slug',
                component: ProductSingle,
                meta: {
                    breadcrumb: 'Product',
                },
            },
            {
                name: 'cart',
                path: '/cart',
                component: CartPage,
                meta: {
                    breadcrumb: 'Cart',
                },
            },
        ]
    }
];

router/index.js

import Vue from 'vue';
import VueRouter from 'vue-router';
import routes from './routes';
import VueBreadcrumbs from 'vue-breadcrumbs';

Vue.use(VueRouter);
Vue.use(VueBreadcrumbs);

const router = createRouter();

export default router;

/**
 * The router factory
 */
function createRouter() {
    const router = new VueRouter({
        mode: 'history',
        routes,
        scrollBehavior(to, from, savedPosition) {
            return {x: 0, y: 0}
        }
    });

    return router;
}
@phuclh phuclh changed the title The children component is not updated The content of children component is not updated Apr 18, 2019
@VasylDmytruk
Copy link

the same problem, how to fix this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants