Skip to content

Gridsome workflow pages names & props #542

Open
@wallythewebdev

Description

@wallythewebdev

HI Guys,

I've been playing around with Gridsome and have come to a fork in the road which from the Docs I have not found a solid / clear answer - maybe its implied, but not stated (or possibly I am being an idiot - this is also common)

Girdsome page names:

Can you set a page name to a page in gridsome?
i.e.

image

Why is this needed:

On the user clicking a component I use this.$router.push(name: X, props: { X: X}) to change the page
I pass an object as a prop to the new page
I did try to use the pages PATH instead of the name but it was unable to pass the prop when doing so

I can add the name manually to the routers.js file in the .temp folder - however if I add a new page - this is then wiped

Am I not using gridsome as it should have been intended? is there a way to add a name to a route?


Passing data to different pages

The above question has seemed from me needing to pass an object with data to different pages as a prop - but gridsome used GraphQL so is it intended that you use GraphQL on each page to get the data for that page and instead should not pass variables?


Any help on clarifying this would be great -
Thanks in advance -
W

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions