Skip to content

When api.fromJSON() is invoked to transfer the result returned by toJSON, an error is reported. #1134

@gcokee

Description

@gcokee

Describe the bug
When api.fromJSON(layout) is invoked to transfer the result returned by api.toJSON(), an error is reported.
Uncaught (in promise) TypeError: Cannot read properties of null (reading'emitsOptions')

To Reproduce

<button @click="handleSaveLayout">Save Layout
<button @Click-"handleRecoverLayout">Recover Layout
<dockview-vue @ready="handleReady">

<script setup lang="ts"> function handleReady(event: DockviewReadyEvent) { dockview = event.api; } /** addpanel function */ ... /** addpanel end */ let layout: string; function handleSaveLayout() { layout = dockview.toJSON(); } function handleRecoverLayout() { dockview.fromJSON(layout); } </script>

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Browser [chrome, electron]
  • Version [dockview-vue 5.1.0]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions