Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Temporary "block content to vue"
<div v-html="renderHtml(content)"></div>
const blocksToHtml = require("@sanity/block-content-to-html")
const h = blocksToHtml.h
const serializers = {
types: {
code: props =>
h("pre", { className: props.node.language }, h("code", props.node.code))
export default {
name: "BlockToHtml",
props: ["content"],
methods: {
renderHtml(item) {
return blocksToHtml({
blocks: item,
serializers: serializers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.