SR
Click to open github profile
Components

CraftNotImplemented

Learn how to use the CraftNotImplemented component.


The CraftNotImplemented componentis a small development helper with the following purposes:

  • Display Unimplemented Block Types: Shows a message indicating any block type that hasn’t been implemented yet.
  • Debug Block Attributes: Outputs the block’s attributes in a readable format for easier debugging.

The NotImplemented component helps quickly identify unmapped or unsupported block types, enhancing flexibility and streamlining your Nuxt/Vue Craft CMS integration.

Usage with Mapping

Example:

<script setup lang="ts">
  import type { Config } from 'vue-craftcms'
  import { CraftPage, CraftNotImplemented } from 'vue-craftcms'
  import Home from '~/templates/pages/home.vue'
  import News from '~/templates/pages/news.vue'

  import ImageText from '~/templates/components/imageText.vue'
  import Headline from '~/templates/components/headline.vue'

  const mapping: Config = {
    pages: {
      home: Home,
      news: News,
    },
    components: {
      imageText: ImageText,
      headline: CraftNotImplemented, // Use it like that or in templated directly
    },
  }

  const { data, error } = await useCraftQuery('entries').uri('__home__').one()
</script>

<template>
  <div>
    <CraftPage
      v-if="data"
      :config="mapping"
      :content="data"
    />
  </div>
</template>

Simple Example in a Component:

headline.vue
<template>
  <CraftNotImplemented />
</template>

Copyright © 2024 Samuel Reichör