prismicio / prismic-vue

Vue plugin, components, and composables to fetch and present Prismic content
https://prismic.io/docs/technologies/vuejs
Apache License 2.0
65 stars 16 forks source link

refactor: `<TodoSliceComponent />` #70

Closed lihbr closed 6 months ago

lihbr commented 6 months ago

Types of changes

Description

Mapped slices would cause the <TODOSliceComponent /> component to throw because of a different interface used by mapped slices (slice type being top level instead of nested under the slice property).

This standardizes the props given to <TODOSliceComponent /> so everything keeps working smoothly based on our Svelte implementation: https://github.com/prismicio/prismic-svelte/blob/master/src/SliceZone/SliceZone.svelte#L118-L128

I first explored adapting the <TODOSliceComponent /> to support different interfaces instead, but it resulted in messier code in my opinion: https://github.com/prismicio/prismic-vue/blob/95d5771b51dc45df5bd6663178afceae8942dc4c/src/components/SliceZone.ts#L263-L280

Checklist: