Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@marvr/storyblok-rich-text-vue-renderer

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@marvr/storyblok-rich-text-vue-renderer

  • 3.2.1
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@marvr/storyblok-rich-text-vue-renderer

Vue 3 plugin for rendering the rich-text content.

Installation

yarn add @marvr/storyblok-rich-text-vue-renderer@next
# or
npm install @marvr/storyblok-rich-text-vue-renderer@next

Usage

Register the plugin

import { createApp } from 'vue';
import App from './App.vue';
import { plugin } from '@marvr/storyblok-rich-text-vue-renderer';

const app = createApp(App);
app.use(plugin(/* options */));
app.mount('#app');

Use the renderer component

<script lang="ts">
import { defineComponent, shallowReactive } from 'vue';
import { RichTextRenderer } from '@marvr/storyblok-rich-text-vue-renderer';

export default defineComponent({
    components: {
        RichTextRenderer
    },
    setup() {
        const doc = shallowReactive(
            // fetched document from Storyblok API
        );

        return { doc }
    }
})
</script>
<template>
    <RichTextRenderer :document="doc">
</template>

Directly use the function

<script lang="ts">
import { defineComponent, shallowReactive } from 'vue';
import { useRenderer } from '@marvr/storyblok-rich-text-vue-renderer';

export default defineComponent({
    components: {
        RichTextRenderer
    },
    setup() {
        const renderer = useRenderer();
        const doc = shallowReactive(
            // fetched document from Storyblok API
        );

        const renderedDocument = renderer.renderDocument(doc);
    }
})
</script>

Keywords

FAQs

Package last updated on 21 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc