Fat Buddha Designs

Affordable, Creative, Hand-Crafted Websites

Items in nodes

Items in nodes in Gridsome


Reading Time: (approx) 1 min

Tags that this post has been filed under.

The main content about Items in nodes

This is just a small code change that was pointed out to me by @courcelan on the Gridsome Discord.

<article v-for="item in $page.sitepages.edges" :key="item.node.id">

Can be replaced with

<article v-for="{ node } in $page.sitepages.edges" :key="node.id">

And then used like this:-

<div v-html="node.content" />

The item can then be missed out, just a little bit less typing, which is great.

Journal Index

Previous Article: My Coding Setup

Next Article: Importing Data from a JSON file