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:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- 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.
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
<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><button @click="handleSaveLayout">Save Layout
<button @Click-"handleRecoverLayout">Recover Layout
<dockview-vue @ready="handleReady">
Steps to reproduce the behavior:
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):
Additional context
Add any other context about the problem here.