Guide
Component props
Props accepted by the shipped Vue Flint renderer. They match the attrs the comark-flint-chart plugin writes on the AST node.
Props accepted by the shipped Vue renderer (match the attrs the plugin writes on the AST node):
| Prop | Type | Default | Description |
|---|---|---|---|
spec | unknown | — | Compiled backend-native chart spec |
backend | string | 'vegalite' | vegalite · echarts (others soft-fail with a visible error) |
width | number | string | 400 | Chart canvas width (px) |
height | number | string | 300 | Chart canvas height (px) |
theme | string | object | — | Theme name/object (already applied at compile time; passthrough) |
input | unknown | — | Original Flint ChartAssemblyInput (passthrough) |
class | string | '' | Extra CSS classes on the wrapper |
Register the Vue component
App.vue
<script setup lang="ts">
import { Markdown } from '@comark/vue'
import flint, { Flint } from 'comark-flint-chart/vue'
</script>
<template>
<Markdown :plugins="[flint()]" :components="{ Flint }">
{{ markdown }}
</Markdown>
</template>
Handle render failures
Render failures soft-fail into a visible .flint-error alert — they do not throw into the page.