Skip to content

Commit d969d04

Browse files
authored
Merge pull request #2269 from adumesny/master
added esmodule.html test
2 parents 39408dd + b52341f commit d969d04

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

demo/esmodule.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<title>ES Module demo</title>
8+
9+
<link rel="stylesheet" href="demo.css"/>
10+
11+
</head>
12+
<body>
13+
<h1>ES Module loading demo</h1>
14+
<div class="grid-stack"></div>
15+
16+
<!-- loading GS as an ES module instead of commonjs all.js. get CORS error though -->
17+
<script type="module">
18+
import { GridStack } from '../dist/gridstack.js';
19+
20+
let items = [{x: 1, y: 1}, {x: 2, y: 2, w: 3}];
21+
let count = 0;
22+
items.forEach(e => e.content = String(count++));
23+
24+
GridStack.init({float: true}).load(items);
25+
</script>
26+
</body>
27+
</html>

demo/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ <h1>Demos</h1>
3535
<li><a href="web-comp.html">Web Component</a></li>
3636
<li><a href="web1.html">Website demo 1</a></li>
3737
<li><a href="web2.html">Website demo 2</a></li>
38+
<li><a href="esmodule.html">ES Module test</a></li>
3839
</ul>
3940
<h1>Angular wrapper</h1>
4041
<p>We now ship an <a href="https://github.com/gridstack/gridstack.js/tree/master/demo/angular/src/app" target="_blank">Angular component wrapper</a>

0 commit comments

Comments
 (0)