Guide

Vue

Bridge the runtime model into Vue with useKvModel and pass it to your Markdown renderer.

useKvModel wraps createKvModel for Vue. Await ready before rendering bound inputs.

Wire up a Vue page

App.vue
<script setup lang="ts">
import { parseMarkdown } from 'comark'
import kv from 'comark-kv'
import { useKvModel } from 'comark-kv/vue'

const tree = await parseMarkdown(markdown, { plugins: [kv()] })
const { model, ready } = useKvModel(tree)
await ready
</script>

<template>
  <Markdown :value="tree" :model="model" />
</template>

Bind two-way props in markdown

Use ::prop on inputs and forms in the document:

bindings.md
:input{::value="kv.name" placeholder="Your name"}
:input{::checked="kv.subscribed" type="checkbox"} Subscribe

Changes flow through the model back to unstorage.

Copyright © 2026