I am using prosemirror in Vue project to build an editor. Working with Prosemirror has been great until I had to create a node that has an input field, which receives an ID for a product we sell. The point I struggled was, the node, when later rendered as a part of a document, has to fetch the data for the product with the ID and display the information in a shape of a card.
In short, this node has two different views on editing surface, and on plain document state.
At first, I thought maybe looping through the doc.content
to create Vue components based on the types of the contents could solve. However I could not move on as soon as I started to wonder about applying some long concatenated marks on a text.
How have you all been rendering the output on your React or Vue projects? I doubt simply innerHTML-ing the generated HTML is not how you did…