dockview
dockview copied to clipboard
Add other components to Vue package (split/grid/pane)view
Describe the bug
In dockview-vue version 4.9.0, when adding a panel via the addPanel method, and using the <Splitview /> component in the panel (even without passing any props to the component), an error is thrown: class constructor splitview cannot be invoked without 'new'.
The outer dockview component renders correctly, but the panel containing Splitview triggers the aforementioned error.
To Reproduce
- Set up a project using dockview-vue 4.9.0
- Render the outer dockview component normally (it works correctly)
- Add a custom panel via the dockview's
addPanelmethod, with the panel component code as follows:<template> <Splitview /> </template> - After running the project, the console shows the error:
class constructor splitview cannot be invoked without 'new'
Expected behavior
The Splitview component is expected to render correctly in the Vue project's panel without the aforementioned constructor invocation error.
Screenshots
No screenshots provided yet (screenshots of the error message can be added if needed).
Desktop (please complete the following information):
- Browser: chrome
- Version: 130+
Additional context
It is observed that the usage examples of the Splitview component in the official dockview documentation (dockview.dev) are based on the React framework. The above error occurs when using it in Vue. We wonder if this component is not yet supported in Vue environments, or if there is a specific usage method that has not been correctly implemented.
Another question: How to maintain a consistent theme in nested instance mode? When passing the theme object via provide/inject and props, an error is triggered during initialization: "cannot read properties of undefined (reading 'split')".
Now I use an independent ref object and update it by watching the external theme, and it can work
const theme = ref(themeLght)
watch(endpoint.params.theme, (newVal) => {
theme.value = newVal
})
The dockview Vue package actually only exports to dockview component and not the others (splitview, gridview etc). Let me add a task to get those added too.
Thanks. By the way, could you please fix the types in dockview-vue? Currently, it's unable to import event types such as WillShowOverlayLocationEvent and DockviewWillDrioEvent from dockview-vue, even from dockview-core.