Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b89aac9

Browse files
authored
Merge pull request gridstack#1407 from adumesny/develop
updated vue3 to match vue2 so easier to diff
2 parents 1fadbc8 + bc48012 commit b89aac9

File tree

4 files changed

+8
-48
lines changed

4 files changed

+8
-48
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ grid.printCount();
176176

177177
search for ['gridstack' under NPM](https://www.npmjs.com/search?q=gridstack&ranking=popularity) for latest, more to come...
178178

179-
- vue.js: see [demo](https://github.com/gridstack/gridstack.js/blob/develop/demo/vuejs.html)
179+
- vue.js: see [demo v3](https://github.com/gridstack/gridstack.js/blob/develop/demo/vue3js.html) or [demo v2](https://github.com/gridstack/gridstack.js/blob/develop/demo/vue2js.html)
180180
- ember: [ember-gridstack](https://github.com/yahoo/ember-gridstack)
181181
- AngularJS: [gridstack-angular](https://github.com/kdietrich/gridstack-angular)
182182
- Angular8: [lb-gridstack](https://github.com/pfms84/lb-gridstack)

demo/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ <h1>Demos</h1>
1818
<li><a href="right-to-left(rtl).html">Right-To-Left (RTL)</a></li>
1919
<li><a href="serialization.html">Serialization</a></li>
2020
<li><a href="two.html">Two grids</a></li>
21-
<li><a href="vuejs.html">Vue.js</a></li>
21+
<li><a href="vuej2s.html">Vue2.js</a></li>
22+
<li><a href="vuej3s.html">Vue3.js</a></li>
2223
</ul>
2324
</body>
2425
</html>
File renamed without changes.

demo/vue3js.html

Lines changed: 5 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Gridstack.js Vue integration example</title>
7+
<link rel="stylesheet" href="demo.css"/>
8+
<script src="../dist/gridstack.all.js"></script>
79
</head>
810
<body>
9-
<link
10-
rel="stylesheet"
11-
href="https://unpkg.com/[email protected]/dist/gridstack.css"
12-
/>
13-
<script src="https://unpkg.com/[email protected]/dist/gridstack.all.js"></script>
1411
<main id="app">
1512
<h1>How to integrate GridStack.js with Vue.js</h1>
1613
<p>
@@ -28,12 +25,11 @@ <h1>How to integrate GridStack.js with Vue.js</h1>
2825
>
2926
to let Vue deal with DOM rendering.
3027
</p>
31-
<button type="button" @click="addNewWidget()">Add Widget</button> {{ info
32-
}}
28+
<button type="button" @click="addNewWidget()">Add Widget</button> {{ info }}
3329
<section class="grid-stack"></section>
3430
</main>
3531
<script type="module">
36-
import { createApp } from "https://unpkg.com/[email protected]/dist/vue.esm-browser.js";
32+
import { createApp } from "https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.esm-browser.js";
3733

3834
createApp({
3935
data() {
@@ -64,11 +60,7 @@ <h1>How to integrate GridStack.js with Vue.js</h1>
6460
},
6561
mounted: function () {
6662
// Provides access to the GridStack instance across the Vue component.
67-
this.grid = GridStack.init({
68-
float: true,
69-
cellHeight: "70px",
70-
minRow: 1,
71-
});
63+
this.grid = GridStack.init({ float: true, cellHeight: '70px', minRow: 1 });
7264

7365
// Use an arrow function so that `this` is bound to the Vue instance. Alternatively, use a custom Vue directive on the `.grid-stack` container element: https://vuejs.org/v2/guide/custom-directive.html
7466
this.grid.on("dragstop", (event, element) => {
@@ -94,38 +86,5 @@ <h1>How to integrate GridStack.js with Vue.js</h1>
9486
},
9587
}).mount("#app");
9688
</script>
97-
<style>
98-
/* Optional styles for demos */
99-
.btn-primary {
100-
color: #fff;
101-
background-color: #007bff;
102-
}
103-
104-
.btn {
105-
display: inline-block;
106-
padding: 0.375rem 0.75rem;
107-
line-height: 1.5;
108-
border-radius: 0.25rem;
109-
}
110-
111-
a {
112-
text-decoration: none;
113-
}
114-
115-
h1 {
116-
font-size: 2.5rem;
117-
margin-bottom: 0.5rem;
118-
}
119-
120-
.grid-stack {
121-
background: #fafad2;
122-
}
123-
124-
.grid-stack-item-content {
125-
color: #2c3e50;
126-
text-align: center;
127-
background-color: #18bc9c;
128-
}
129-
</style>
13089
</body>
13190
</html>

0 commit comments

Comments
 (0)