-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: added articles route to approach testing of usecase
- Loading branch information
1 parent
3851af9
commit 96fd3c8
Showing
4 changed files
with
57 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script setup lang="ts"> | ||
const path = useRoute(); | ||
const story = await useAsyncStoryblok(`vue/articles/${path.params.slug}`, { | ||
version: "draft", | ||
language: "en" | ||
}); | ||
</script> | ||
|
||
<template> | ||
<main v-editable class="container mx-auto pt-24"> | ||
<h2>{{ story.content.title }}</h2> | ||
</main> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<script setup lang="ts"> | ||
const storyblokApi = useStoryblokApi(); | ||
const { data: articles } = await storyblokApi.get("cdn/stories/", { | ||
version: "draft", | ||
starts_with: "vue/articles", | ||
is_startpage: false | ||
}); | ||
/* const storyblokApi = useStoryblokApi() | ||
const { data: articles } = await storyblokApi.get('cdn/stories/vue', { | ||
version: 'draft', | ||
starts_with: 'articles', | ||
is_startpage: false, | ||
}) | ||
console.count('Articles Fetch') */ | ||
</script> | ||
|
||
<template> | ||
<div class="container mx-auto"> | ||
<h1>Articles</h1> | ||
<p>Here are some articles</p> | ||
<div class="pt-24"> | ||
<NuxtLink | ||
v-for="article in articles.stories" | ||
:key="article.uuid" | ||
:to="`/articles/${article.slug}`" | ||
> | ||
<h2>{{ article.name }}</h2> | ||
</NuxtLink> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters