Skip to content

Commit

Permalink
Fix nuxt link snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-mp committed Nov 25, 2024
1 parent 11a7ddc commit 78a449a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/adapter-nuxt/src/hooks/snippet-read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ export const snippetRead: SnippetReadHook<PluginOptions> = async (
`;
} else if (repeat && !allowText) {
codeText = stripIndent`
<template v-for="(link, index) in ${dotPath(fieldPath)}" :key="index">
<template v-for="link in ${dotPath(fieldPath)}" :key="link.key">
<PrismicLink :field="link">Link</PrismicLink>
</template>
`;
} else if (repeat && allowText) {
codeText = stripIndent`
<template v-for="(link, index) in ${dotPath(fieldPath)}" :key="index">
<template v-for="link in ${dotPath(fieldPath)}" :key="link.key">
<PrismicLink :field="link" />
</template>
`;
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-nuxt2/src/hooks/snippet-read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ export const snippetRead: SnippetReadHook<PluginOptions> = async (
`;
} else if (repeat && !allowText) {
codeText = stripIndent`
<template v-for="(link, index) in ${dotPath(fieldPath)}" :key="index">
<template v-for="link in ${dotPath(fieldPath)}" :key="link.key">
<PrismicLink :field="link">Link</PrismicLink>
</template>
`;
} else if (repeat && allowText) {
codeText = stripIndent`
<template v-for="(link, index) in ${dotPath(fieldPath)}" :key="index">
<template v-for="link in ${dotPath(fieldPath)}" :key="link.key">
<PrismicLink :field="link" />
</template>
`;
Expand Down

0 comments on commit 78a449a

Please sign in to comment.