DHTMLX Kanban. Vue integration example
This demo shows how to embed DHTMLX Kanban into a Vue 3 application. The Kanban board initializes as a vanilla JavaScript widget inside a Vue component. For a step-by-step setup guide, see the detailed Vue integration guide.
View on GitHub. Open the repository and click "Open in Codespaces" on the README page to launch a fully configured Vue app with DHTMLX Kanban in seconds. No local setup required.
The demo creates a Kanban.vue component that receives data through Vue props. Inside mounted, it instantiates the vanilla Kanban class using this.$refs for DOM access, passing columns, cards, swimlane rows, card shape configuration, and a custom editor shape that adds links and comments. A Toolbar is connected to the board through kanban.api. The unmounted hook calls destructor() on both instances.
Solution overview
- Create a custom
Kanban.vuecomponent - Use the
refdirective to access DOM elements for Kanban and Toolbar containers - In the
mountedlifecycle hook, initialize Kanban with thenew Kanban(this.$refs.kanban_container, { columns, cards, rows, rowKey, cardShape, editorShape, currentUser })constructor - Call the
new Toolbar(this.$refs.toolbar_container, { api: this.kanban.api })constructor to create a Toolbar instance and bind it to Kanban - In the
unmountedlifecycle hook, callthis.kanban.destructor()andthis.toolbar.destructor()calldestructor()to clean up DOM nodes and event listeners for Kanban and Toolbar
API reference
- Kanban constructor: Creates a new Kanban instance
- columns: Defines the board columns
- cards: Defines the task cards
- rows: Defines swimlane rows
- cardShape: Configures which card fields are visible
- editorShape: Configures the card editor fields
- Toolbar: Toolbar widget overview