78 lines
3.1 KiB
HTML
78 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Vue Grid Layout Example 2 - Move and resize events</title>
|
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
<link rel="stylesheet" href="app.css">
|
|
<!--<link rel="stylesheet" href="../dist/vue-grid-layout.css">-->
|
|
</head>
|
|
<body>
|
|
<h1>Vue Grid Layout Example 2 - Move and resize events</h1>
|
|
|
|
<a href="https://github.com/jbaysolutions/vue-grid-layout">View project on Github</a>
|
|
<br/>
|
|
<a href="01-basic.html">Previous example: Basic</a>
|
|
<br/>
|
|
<a href="03-multiple-grids.html">Next example: Multiple grids</a>
|
|
|
|
<div id="app" style="width: 100%;">
|
|
<!--<pre>{{ $data | json }}</pre>-->
|
|
<div>
|
|
<div class="layoutJSON">
|
|
Displayed as <code>[x, y, w, h]</code>:
|
|
<div class="columns">
|
|
<div class="layoutItem" v-for="item in layout">
|
|
<b>{{item.i}}</b>: [{{item.x}}, {{item.y}}, {{item.w}}, {{item.h}}]
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div ref="eventsDiv" class="eventsJSON">
|
|
Events:
|
|
<div v-for="event in eventLog">
|
|
{{event}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="content">
|
|
<!--<button @click="decreaseWidth">Decrease Width</button>
|
|
<button @click="increaseWidth">Increase Width</button>
|
|
<button @click="addItem">Add an item</button>-->
|
|
<grid-layout :layout="layout"
|
|
:col-num="12"
|
|
:row-height="30"
|
|
:is-draggable="true"
|
|
:is-resizable="true"
|
|
:vertical-compact="true"
|
|
:use-css-transforms="true"
|
|
@layout-created="layoutCreatedEvent"
|
|
@layout-before-mount="layoutBeforeMountEvent"
|
|
@layout-mounted="layoutMountedEvent"
|
|
@layout-ready="layoutReadyEvent"
|
|
@layout-updated="layoutUpdatedEvent"
|
|
>
|
|
<grid-item v-for="item in layout"
|
|
:x="item.x"
|
|
:y="item.y"
|
|
:w="item.w"
|
|
:h="item.h"
|
|
:i="item.i"
|
|
@resize="resizeEvent"
|
|
@move="moveEvent"
|
|
@resized="resizedEvent"
|
|
@container-resized="containerResizedEvent"
|
|
@moved="movedEvent"
|
|
>
|
|
<span class="text">{{item.i}}</span>
|
|
</grid-item>
|
|
</grid-layout>
|
|
</div>
|
|
<!--<pre>{{eventLog | json}}</pre>-->
|
|
|
|
</div>
|
|
<script src="vue.min.js"></script>
|
|
<script src="../dist/vue-grid-layout.umd.min.js"></script>
|
|
<script src="02-events.js"></script>
|
|
</body>
|
|
</html>
|