An open API service indexing awesome lists of open source software.

https://github.com/xhlife/vue3-grid-layout

About A draggable and resizable grid layout, for Vue3.
https://github.com/xhlife/vue3-grid-layout

drag-drop grid resize vue3 vue3-typescript

Last synced: about 1 year ago
JSON representation

About A draggable and resizable grid layout, for Vue3.

Awesome Lists containing this project

README

          

# Support By

This project js support by [vue-grid-layout](https://github.com/jbaysolutions/vue-grid-layout), but vue-grid-layout do not support vue3.

# Vue 3 + TypeScript + Vite

The template uses Vue 3 `` SFCs, so pay attention to the version of vue.

## Supports Vue 3.2+

# Usage

```shell
npm i vue3-grid-layout-next
```

<h2>
<a href="https://jbaysolutions.github.io/vue-grid-layout/" target="_blank">Documentation Website</a>
</h2>

## add Scoped slot
```html
<grid-item v-slot="{style}">
<div>
<!-- get attribute, such as width,height, and so no -->
{{ style }}
</div>
</grid-item>
```

## add dragging、 dragend event

```html
<grid-item
@dragging="doSomething"
@dragend="doSomethingEnd"
>
</grid-item>

<script lang="ts" setup>

function doSomethin(event: MouseEvent, i: number | string) {

}

```

## beware

### Usage with v-model

```html

...

```

### Use ref object

If the responsive property is true, make sure layout is a ref object

```html

const responsive = ref(true)
const layout = ref([])
// const layout = reactive([]) // will cause some bug

// it will work, when responsive is false
// const layout = reactive([])



...

```

# example

[demo for echart](https://cxid.gitee.io/works/work/vue3-grid-layout/index.html) - [source:https://gitee.com/cxid/vue3-grid-layout-demo](https://gitee.com/cxid/vue3-grid-layout-demo)