Vue Grid Layout is a component library for Vue.js that provides a draggable and resizable grid layout system. It enables developers to create interactive dashboards and editable layouts where users can freely arrange, resize, and manage widgets. The current stable version, 2.4.0, supports Vue 2.2+. The library is actively maintained with a focus on bug fixes and incremental feature enhancements, without a strict release cadence. It offers features such as static widgets, bounds checking for drag and resize operations, layout serialization and restoration, automatic RTL support, and responsive design capabilities. It was heavily inspired by React-Grid-Layout. For Vue 3, there are community-maintained forks and dedicated libraries like `vue-grid-layout-v3`, `vue3-grid-layout`, and `@marsio/vue-grid-layout`, as the original `vue-grid-layout` does not officially support Vue 3.
npm install vue-grid-layoutVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a basic Vue 2 application using `vue-grid-layout` with several draggable and resizable grid items. It shows how to define a layout programmatically and handle `resized` and `moved` events.
For Vue 3 projects, consider using a dedicated Vue 3 compatible library like `vue-grid-layout-v3` (npm `vue-grid-layout-v3`) or `@marsio/vue-grid-layout` (npm `@marsio/vue-grid-layout`), or investigate other grid layout solutions tailored for Vue 3.
Ensure your `vue-grid-layout` version matches your Vue.js installation. Consult the README for the exact version compatibility matrix for legacy Vue environments.
Always use the latest stable version (2.4.0) for the most reliable responsive behavior. If on an older version, review the changelog for responsive-related fixes that might address your issue.
Ensure you are using the correct event name: `@resized` for item-specific resizing and consider using `@container-resized` (or similar, check current docs) for layout container resizing events. Always refer to the latest documentation for event names.
Ensure your build tooling (e.g., Webpack, Rollup) is configured to handle ES6 module imports and tree-shaking effectively. For older or legacy build setups, this might require specific adjustments or using an older `vue-grid-layout` version (e.g., 2.3.9 or earlier) if compatibility issues arise.
Upgrade to `vue-grid-layout` version 2.3.10 or later, as this issue was specifically fixed in that release.
This bug was addressed in version 2.3.8. Ensure you are using `vue-grid-layout` version 2.3.8 or newer. Also, ensure that your `layout` array is updated correctly when items are added or removed.
Update to `vue-grid-layout` version 2.3.10 or later, where this specific bug was fixed. Ensure proper handling of `v-if` or `v-show` on `GridItem` components.
Upgrade to `vue-grid-layout` version 2.3.9 or newer. If you need to support Vue 2.1.10 and below, use version 2.1.3 of `vue-grid-layout`.