Skip to content

Commit 6e68587

Browse files
authored
Merge pull request #3 from dnohashi/elec
Changed component from VueDraggableResizable to VueDragResize
2 parents 8353f4f + 3be2ac1 commit 6e68587

File tree

9 files changed

+1033
-16
lines changed

9 files changed

+1033
-16
lines changed

package-lock.json

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

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@
1616
"localforage": "^1.7.3",
1717
"mousetrap": "^1.6.3",
1818
"quasar": "^1.0.0",
19+
"vue-drag-resize": "^1.3.2",
1920
"vue-draggable-resizable": "^2.0.0-rc2",
2021
"vue-multiselect": "^2.1.6",
21-
"vued3tree": "^3.7.1"
22+
"vued3tree": "^3.7.1",
23+
"vuex": "^3.1.1"
2224
},
2325
"devDependencies": {
2426
"@quasar/app": "^1.0.0",
2527
"@vue/eslint-config-standard": "^4.0.0",
2628
"babel-eslint": "^10.0.1",
2729
"devtron": "^1.4.0",
2830
"electron": "^5.0.6",
31+
"electron-builder": "^20.44.4",
2932
"electron-debug": "^3.0.1",
3033
"electron-devtools-installer": "^2.2.4",
3134
"eslint": "^5.10.0",

quasar.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ module.exports = function (ctx) {
147147
},
148148

149149
electron: {
150-
// bundler: 'builder', // or 'packager'
150+
bundler: 'builder', // or 'packager'
151151

152152
extendWebpack (cfg) {
153153
// do something with Electron main process Webpack cfg

src/components/ComponentDisplay.vue

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="component-display">
3-
<VueDraggableResizable
3+
<!-- <VueDraggableResizable
44
class-name="component-box"
55
v-for="componentData in activeRouteArray"
66
:key="componentData.componentName"
@@ -9,24 +9,43 @@
99
:w="componentData.w"
1010
:h="componentData.h"
1111
:parent="true"
12+
class-name-resizable="my-resizable-class"
1213
@activated="onActivated(componentData)"
1314
@deactivated="onDeactivated(componentData)"
1415
@dragging="onDrag"
1516
@resizing="onResize"
1617
@dblclick.native="onDoubleClick(componentData)"
1718
>
1819
<h3>{{ componentData.componentName }}</h3>
19-
</VueDraggableResizable>
20+
</VueDraggableResizable> -->
21+
<VueDragResize
22+
:isActive="true"
23+
v-for="componentData in activeRouteArray"
24+
:key="componentData.componentName"
25+
:x="componentData.x"
26+
:y="componentData.y"
27+
:w="componentData.w"
28+
:h="componentData.h"
29+
@resizing="onResize"
30+
@dragging="onDrag"
31+
@activated="onActivated(componentData)"
32+
@deactivated="onDeactivated(componentData)"
33+
@dblclick.native="onDoubleClick(componentData)"
34+
>
35+
<h3>{{ componentData.componentName }}</h3>
36+
</VueDragResize>
2037
</div>
2138
</template>
2239
<script>
2340
import { mapState, mapActions } from 'vuex'
24-
import VueDraggableResizable from 'vue-draggable-resizable'
41+
// import VueDraggableResizable from 'vue-draggable-resizable'
42+
import VueDragResize from 'vue-drag-resize'
2543
2644
export default {
2745
name: 'ComponentDisplay',
2846
components: {
29-
VueDraggableResizable
47+
// VueDraggableResizable
48+
VueDragResize
3049
},
3150
data () {
3251
return {
@@ -59,15 +78,25 @@ export default {
5978
},
6079
methods: {
6180
...mapActions(['setActiveComponent', 'updateOpenModal']),
62-
onResize: function (x, y, width, height) {
63-
this.activeComponentData.x = x
64-
this.activeComponentData.y = y
65-
this.activeComponentData.w = width
66-
this.activeComponentData.h = height
81+
// onResize: function (x, y, width, height) {
82+
// this.activeComponentData.x = x
83+
// this.activeComponentData.y = y
84+
// this.activeComponentData.w = width
85+
// this.activeComponentData.h = height
86+
// },
87+
onResize (rectangle) {
88+
this.activeComponentData.y = rectangle.top
89+
this.activeComponentData.x = rectangle.left
90+
this.activeComponentData.w = rectangle.width
91+
this.activeComponentData.h = rectangle.height
6792
},
68-
onDrag: function (x, y) {
69-
this.activeComponentData.x = x
70-
this.activeComponentData.y = y
93+
// onDrag: function (x, y) {
94+
// this.activeComponentData.x = x
95+
// this.activeComponentData.y = y
96+
// },
97+
onDrag (rectangle) {
98+
this.activeComponentData.y = rectangle.top
99+
this.activeComponentData.x = rectangle.left
71100
},
72101
onActivated (componentData) {
73102
this.setActiveComponent(componentData.componentName)
@@ -97,4 +126,8 @@ export default {
97126
color: white;
98127
border: 1px solid salmon;
99128
}
129+
130+
h3 {
131+
text-align: center;
132+
}
100133
</style>

src/components/FooterTabView.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
<script>
3737
export default {
38+
name: 'FooterTabView.vue',
3839
data () {
3940
return {
4041
tab: 'tree'

src/components/TopMenuBar.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,17 @@
8787
</q-bar>
8888
</div>
8989
</template>
90+
91+
<script>
92+
export default {
93+
name: 'TopMenuBar',
94+
components: {
95+
QMenu,
96+
QItem,
97+
QSeparator,
98+
QItemSection,
99+
QList,
100+
QBtn
101+
}
102+
}
103+
</script>
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)