vuetify-contentful

0.0.2 • Public • Published

Contentful Vuetify Media Renderer

Vuetify renderer for the Contentful media field type.

Getting Started

Install

From CDN

<script src="https://cdn.jsdelivr.net/npm/vuetify-contentful"></script>

From npm

npm install vuetify-contentful

Usage

HTML

<contentful-vue-media-renderer :content="content.heroImage" />

Script

import ContentfulVuetifyMediaRenderer from 'vuetify-contentful';

export default {
  components: {
    ContentfulVuetifyMediaRenderer,
  },
  data() {
    return {
      content: {
        heroImage: {
          sys: {
            space: { sys: { type: 'Link', linkType: 'Space', id: 'spaceId' } },
            id: 'mediaId',
            type: 'Asset',
            createdAt: '2020-08-25T21:08:33.500Z',
            updatedAt: '2020-08-25T21:08:33.500Z',
            environment: { sys: { id: 'master', type: 'Link', linkType: 'Environment' } },
            revision: 1,
            locale: 'en-US',
          },
          fields: {
            title: 'Laptop on a desk',
            file: {
              url: '//picsum.photos/200/300',
              details: { size: 231644, image: { width: 1951, height: 1301 } },
              fileName: 'picsum.jpg',
              contentType: 'image/jpeg',
            },
          },
        },
      },
    };
  },

/vuetify-contentful/

    Package Sidebar

    Install

    npm i vuetify-contentful

    Weekly Downloads

    2

    Version

    0.0.2

    License

    none

    Unpacked Size

    24.1 kB

    Total Files

    14

    Last publish

    Collaborators

    • halceyon