question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Best approach for loading new Doc back into Editor

See original GitHub issue

Hey Lee,

First of all, great work on this plug-in! It’s made my job a hell of a lot easier over recent months. I appreciate you adding my feature request as well.

Anyway, I have a quick question about loading data back into the editor… I am able to retrieve it and successfully load it into the editor. However, I am mutating the prop directly by using this.content = recentDoc within my setter function. I know this is a bad pattern, and I fear it’s now refreshing the editor state either. I have looked into the TipTap documentation on the matter and it appears people are doing this with this.editor.setContent(content) but I realize these methods aren’t available with el-tiptap. I was looking into the Prosemirror props such as content, emitUpdate, parseOptions but I am unclear about how/where to implement them.

Maybe you could steer me in the right direction?

Let me know, thanks!

Shad

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Leecasoncommented, Jun 12, 2020
<el-tiptap v-model="content"></el-tiptap>

You can use v-model to bind content then you can update content in your app or

template:

<el-tiptap @onInit="onInit"></el-tiptap>

js:

onInit({ editor }) {
  // you can access to `editor`, then you can editor.setContent(yourContent).
}
0reactions
shadrachtuckcommented, Jul 30, 2020

https://codesandbox.io/s/element-tiptap-x101r?file=/src/components/Editor.vue

This demo isn’t providing the same lag it was for me. However, I am running vue in electron and have other factors in the project. This demo is about as stripped-down as it gets. I solved the issue with a workaround, however it seems for me that onInit keeps sending event updates and loading a new version of the editor event while the document is edited.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create or import files - Google Workspace Learning Center
If you have existing files, you can import and convert them to Docs, Sheets, or Slides. Go to Drive. Click New and then...
Read more >
Editing Documents in Google Drive
This is cumbersome, but there is a better way to edit these files now and that is by using AODocs Universal File Opener....
Read more >
Edit a document in a document library - Microsoft Support
Another option for editing from a document library is to click the Show Actions ellipses ... > Open. You may also have the...
Read more >
The best way to edit a PDF in Google Drive
Open the PDF with Google Docs by right-clicking and selecting Open With > Google Docs. Once your file opens in Google Docs you...
Read more >
How to Share and Edit Files on Google Drive - YouTube
How to Share and Edit Files on Google DriveIt's easy to create and share files, text documents, spreadsheets, and presentations in Google ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found