Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Simple Developer
Simple Developer
Maybe your site article has relation with categories and tags.nThis tutorial shows how to filtering articles by tag.
Maybe your site article has relation with categories and tags.
This tutorial shows how to filtering articles by tag.
--- name: Test description: This is test tag ---
tags
front matter to content--- title: This is test post tags: - Test - Nuxt --- This is test post. Hello World.
tags/_slug/index.vue
fileAdd where clause to filtering articles by selected tag.
<template> <div> <!-- Your html code --> </div> </template> <script> export default { async asyncData({ $content, params }) { const tag = await $content('tags', params.slug).fetch() const articles = await $content('articles') .only(['title', 'description', 'img', 'slug', 'tags']) .where({ 'tags': { $contains: tag.name } }) .sortBy('createdAt', 'asc') .fetch() return { tag, articles } } } </script>