Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gridsome workflow pages names & props #542

Open
wallythewebdev opened this issue Oct 30, 2020 · 3 comments
Open

Gridsome workflow pages names & props #542

wallythewebdev opened this issue Oct 30, 2020 · 3 comments

Comments

@wallythewebdev
Copy link

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

@travis-r6s
Copy link
Member

@wallythewebdev This is not (perhaps yet) possible in Gridsome, no. There is an open issue about this: gridsome/gridsome#756

I realise this is a bit late to answer, but just for future reference the Gridsome discord community is a bit more active, and you may get a answer quicker there!

@wallythewebdev
Copy link
Author

Hi there -

Thanks for the reply. I'll keep and eye on the issue and thanks for the tip on the discord.

@camwhite
Copy link

camwhite commented Jun 3, 2021

Here's a solution for anybody still looking 💯

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

No branches or pull requests

3 participants