Skip to content

Commit 0c25cb2

Browse files
Merge pull request #2 from serhiipylypchuk1991/sp-refactor
[dev] refactoring
2 parents a1b33c7 + e966686 commit 0c25cb2

File tree

12 files changed

+139
-127
lines changed

12 files changed

+139
-127
lines changed

.devcontainer/devcontainer.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"updateContentCommand": "yarn",
3+
"postAttachCommand": "yarn start",
4+
"customizations": {
5+
"codespaces": {
6+
"openFiles": ["src/App.vue"]
7+
}
8+
}
9+
}

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@dhx:registry=https://npm.dhtmlx.com/
1+
@dhx:registry=https://npm.dhtmlx.com/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![dhtmlx.com](https://img.shields.io/badge/made%20by-DHTMLX-blue)](https://dhtmlx.com/)
44

5-
![DHTMLX Diagram with Vue Demo](https://raw.githubusercontent.com/DHTMLX/vue-diagram-demo/master/diagram.png)
5+
![DHTMLX Diagram with Vue Demo](diagram_editor.png)
66

77
## How to start
88

diagram_editor.png

451 KB
Loading

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/x-icon" href="/favicon.ico">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>DHX Diagram with Vue</title>
7+
<title>DHX Diagram Vue</title>
88
</head>
99
<body>
1010
<div id="root"></div>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"deploy": "yarn build && gh-pages -d dist"
99
},
1010
"dependencies": {
11-
"@dhx/trial-diagram": "^6.0.1",
11+
"@dhx/trial-diagram": "^6.0.5",
1212
"vue": "^3.2.37"
1313
},
1414
"devDependencies": {

src/App.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<script>
2-
import Diagram from "./components/Diagram.vue";
2+
import DiagramEditor from "./components/DiagramEditor.vue";
33
import { getData } from "./data";
44
55
export default {
6-
components: { Diagram },
6+
components: { DiagramEditor },
77
data() {
88
return {
9-
data: getData(),
9+
data: getData()
1010
};
11-
},
11+
}
1212
};
1313
</script>
1414

1515
<template>
16-
<Diagram :data="data" />
16+
<DiagramEditor :data="data" />
1717
</template>

src/components/Diagram.vue

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/components/DiagramEditor.vue

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<script>
2+
import "@dhx/trial-diagram/codebase/diagram.min.css";
3+
import { DiagramEditor } from "@dhx/trial-diagram";
4+
5+
export default {
6+
props: ["data"],
7+
8+
mounted() {
9+
this.diagram_editor = new DiagramEditor(this.$refs.container, {
10+
type: "default"
11+
});
12+
this.diagram_editor.parse(this.data);
13+
},
14+
15+
unmounted() {
16+
this.diagram_editor.destructor();
17+
}
18+
};
19+
</script>
20+
21+
<template>
22+
<div ref="container" class="widget"></div>
23+
</template>

src/data.js

Lines changed: 87 additions & 87 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)