npm.io
0.0.17 • Published 5 months ago

@bicou/prosemirror-render-vue

Licence
MIT
Version
0.0.17
Deps
2
Size
8 kB
Vulns
0
Weekly
0
Stars
10

@bicou/prosemirror-render-vue

 Documentation

This plugin allows you to render ProseMirror JSON data in your Vue applications. It provides a Vue component that translates ProseMirror nodes and marks to customizable Vue components or HTML elements.

  • From ProseMirror JSON :
{
  "type": "doc",
  "content": [
    {
      "type": "paragraph",
      "attrs": {
        "id": "the-line"
      },
      "content": [
        {
          "type": "text",
          "text": "The line."
        }
      ]
    }
  ]
}
  • Through Vue Vnodes :
h("div", [h("p", { id: "the-line" }, "The line.")]);
  • To DOM :
<div><p id="the-line">The line.</p></div>