-
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.
Merge pull request #814 from storyblok/bugfix/769-storyblok-making-re…
…quests-clientside-on-full-static-site fix: 769 storyblok making requests clientside on full static site
- Loading branch information
Showing
6 changed files
with
70 additions
and
20 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
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
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