gridsome / gridsome/gridsome.org

Gridsome workflow pages names & props

Open
#542 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
292
Forks
301
PR merge metrics
No merged PRs in 30d

Description

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](https://user-images.githubusercontent.com/28821463/97675512-5b52eb00-1a87-11eb-9fd6-4a2c7ccf0037.png)

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the issue's questions about page names, router navigation, props, and GraphQL data loading, along with the generated .temp/routers.js behavior. Compare the existing documentation with these workflows and identify what is missing or ambiguous. Done means the docs clearly explain the supported route naming and page-to-page data approach without relying on generated files.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, javascript
Domain
documentation, web-dev
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.