Skip to content

Commit 9f755a9

Browse files
authored
Merge pull request #1 from NilubaJashanaS/master
Adding vue dashboard layout sample
2 parents c0f88d0 + 5ff6055 commit 9f755a9

File tree

10 files changed

+135
-1
lines changed

10 files changed

+135
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1-
# getting-started-with-the-vue-dashboard-layout-component
1+
# Getting Started with the Vue Dashboard Layout Component
2+
23
A quick-start project that helps you to integrate a Vue Dashboard Layout component in a Vue application. This project contains code to add multiple panels and configure them, drag, and resize the panels dynamically.
4+
5+
Refer to the following documentation to learn about the Vue Dashboard Layout component:
6+
https://ej2.syncfusion.com/vue/documentation/dashboard-layout/getting-started
7+
8+
Check out this online example of the Vue Dashboard Layout component:
9+
https://ej2.syncfusion.com/vue/demos/#/material/dashboard-layout/default.html
10+
11+
## Project prerequisites
12+
Make sure that you have the compatible versions of [Visual Studio Code](https://code.visualstudio.com/download ) and [NodeJS](https://nodejs.org/en/download) or later version in your machine before starting to work on this project.
13+
14+
## How to run this application
15+
To run this application, you need to first clone the `getting-started-with-the-vue-dashboard-layout-component` repository and then open it in Visual Studio Code. Now, simply build and run your project to view the output.

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + Vue</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.js"></script>
12+
</body>
13+
</html>

package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "myvueapp",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"@syncfusion/ej2-vue-layouts": "^23.1.36",
13+
"vue": "^3.3.4"
14+
},
15+
"devDependencies": {
16+
"@vitejs/plugin-vue": "^4.2.3",
17+
"vite": "^4.4.5"
18+
}
19+
}

public/vite.svg

Lines changed: 1 addition & 0 deletions
Loading

src/App.vue

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<script>
2+
import { DashboardLayoutComponent, PanelsDirective, PanelDirective } from '@syncfusion/ej2-vue-layouts';
3+
4+
export default {
5+
components: {
6+
'ejs-dashboardlayout' : DashboardLayoutComponent,
7+
'e-panels' : PanelsDirective,
8+
'e-panel' : PanelDirective
9+
}
10+
}
11+
</script>
12+
13+
<template>
14+
<ejs-dashboardlayout columns="3" :allowDragging="false" :allowResizing="true">
15+
<e-panels>
16+
<e-panel :row="0" :col="0" :sizeY="2" :minSizeY="1" :maxSizeY="2" header="<div>Panel 1</div>" content="<div>Content of Panel 1</div>"></e-panel>
17+
<e-panel :row="0" :col="1" header="<div>Panel 2</div>" content="<div>Content of Panel 2</div>"></e-panel>
18+
<e-panel :col="2" header="<div>Panel 3</div>" content="<div>Content of Panel 3</div>"></e-panel>
19+
<e-panel :row="1" :col="1" :sizeX="2" :minSizeX="1" :maxSizeX="2" header="<div>Panel 4</div>" content="<div>Content of Panel 4</div>"></e-panel>
20+
</e-panels>
21+
</ejs-dashboardlayout>
22+
</template>
23+
24+
<style>
25+
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
26+
@import "../node_modules/@syncfusion/ej2-vue-layouts/styles/material.css";
27+
28+
.e-panel-header {
29+
text-align: center;
30+
}
31+
.e-panel-content {
32+
text-align: center;
33+
}
34+
</style>

src/assets/vue.svg

Lines changed: 1 addition & 0 deletions
Loading

src/components/HelloWorld.vue

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<script setup>
2+
import { ref } from 'vue'
3+
4+
defineProps({
5+
msg: String,
6+
})
7+
8+
const count = ref(0)
9+
</script>
10+
11+
<template>
12+
<h1>{{ msg }}</h1>
13+
14+
<div class="card">
15+
<button type="button" @click="count++">count is {{ count }}</button>
16+
<p>
17+
Edit
18+
<code>components/HelloWorld.vue</code> to test HMR
19+
</p>
20+
</div>
21+
22+
<p>
23+
Check out
24+
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
25+
>create-vue</a
26+
>, the official Vue + Vite starter
27+
</p>
28+
<p>
29+
Install
30+
<a href="https://github.com/vuejs/language-tools" target="_blank">Volar</a>
31+
in your IDE for a better DX
32+
</p>
33+
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
34+
</template>
35+
36+
<style scoped>
37+
.read-the-docs {
38+
color: #888;
39+
}
40+
</style>

src/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { createApp } from 'vue'
2+
import './style.css'
3+
import App from './App.vue'
4+
import {registerLicense} from '@syncfusion/ej2-base';
5+
registerLicense("Ngo9BigBOggjHTQxAR8/V1NHaF5cWWNCf1JpRGNGfV5yd0VAalxRTnJZUiweQnxTdEZiWX5YcHxQRGRfV0Z3XA==");
6+
createApp(App).mount('#app')

src/style.css

Whitespace-only changes.

vite.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'vite'
2+
import vue from '@vitejs/plugin-vue'
3+
4+
// https://vitejs.dev/config/
5+
export default defineConfig({
6+
plugins: [vue()],
7+
})

0 commit comments

Comments
 (0)