
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
vue-strapi-blocks-renderer
Advanced tools
A Vue renderer for the Strapi's Blocks rich text editor. Compatible with Nuxt.
Easily render the content of Strapi's new Blocks rich text editor in your Vue frontend.
Based on @strapi/blocks-react-renderer
Install the Blocks renderer and its peer dependencies:
npm install vue-strapi-blocks-renderer vue
After fetching your Strapi content, you can use the BlocksRenderer component to render the data from a blocks attribute. Pass the array of blocks coming from your Strapi API to the content
prop:
import { StrapiBlocks, type BlocksContent } from 'vue-strapi-blocks-renderer';
// Content should come from your Strapi API
const content: BlocksContent = [
{
type: 'paragraph',
children: [{ type: 'text', text: 'A simple paragraph' }],
},
];
const VNode = StrapiBlocks({ content: content });
<template>
<VNode />
</template>
Or
import { StrapiBlocks } from 'vue-strapi-blocks-renderer';
<template>
<StrapiBlocks :content="content" :modifiers="modifiers" :blocks="blocks" />
</template>
You can provide your own Vue components to the renderer, both for blocks and modifier. They will be merged with the default components, so you can override only the ones you need.
level
)format
)plainText
)image
)url
)To provide your own components, pass an object to the blocks and modifiers props of the renderer. For each type, the value should be a React component that will receive the props of the block or modifier. Make sure to always render the children, so that the nested blocks and modifiers are rendered as well.
import { h } from 'vue';
import {
StrapiBlocks,
type BlocksComponents,
type ModifiersComponents,
} from 'vue-strapi-blocks-renderer';
const userBlocks: BlocksComponents = {
// Will include the class "mb-4" on all paragraphs
paragraph: (props) => h('p', { class: 'mb-4' }, props.children),
};
const userModifier: ModifiersComponents = {
// Will include the class "text-red" on all bold text
bold: (props) => h('strong', { class: 'text-red' }, props.children),
};
const VNode = StrapiBlocks({
content: content,
modifier: userModifier,
blocks: userBlocks,
});
FAQs
A Vue renderer for the Strapi's Blocks rich text editor. Compatible with Nuxt.
The npm package vue-strapi-blocks-renderer receives a total of 1,095 weekly downloads. As such, vue-strapi-blocks-renderer popularity was classified as popular.
We found that vue-strapi-blocks-renderer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.