Skip to content

Render updated content from on Vue when edited using the editor #135

@aymericzip

Description

@aymericzip

When using the visual editor in both React and Vue implementations of Intlayer, changes are correctly tracked and stored. However, only the React implementation successfully renders the updated content in the frontend. In the Vue version, the edited content is not reflected in the DOM after editing.


React Behavior (✅ Works as expected):

  • The visual editor stores changes in EditedContentContext
  • Then, useEditedContentRenderer replaces the current node with the edited version
  • This is correctly rendered in IntlayerNodePlugin

https://github.com/aymericzip/intlayer/blob/main/packages/@intlayer/editor-react/src/EditedContentContext.tsx
https://github.com/aymericzip/intlayer/blob/main/packages/react-intlayer/src/editor/useEditedContentRenderer.tsx
https://github.com/aymericzip/intlayer/blob/main/packages/react-intlayer/src/plugins.tsx


Vue Behavior (❌ Buggy or Incomplete):


Expected Behavior:

Vue’s intlayerNodePlugins should mirror the React logic: after a node is edited and saved in the editedContent ref, the rendered node should reflect the update without requiring a full refresh or manual intervention.


Suggested Fix:

Ensure vue-intlayer/src/plugins.ts reads from editedContent and replaces the node tree similarly to useEditedContentRenderer.tsx in React. It may require introducing a computed mapping or watcher on editedContent to conditionally render edited nodes in intlayerNodePlugins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions