Skip to content

Commit 3b7ac9a

Browse files
authored
Merge pull request #8 from deanfchung/electron
Electron
2 parents 04ef9f6 + d813941 commit 3b7ac9a

23 files changed

+734
-67
lines changed

package-lock.json

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

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@
1717
"mousetrap": "^1.6.3",
1818
"prismjs": "^1.16.0",
1919
"quasar": "^1.0.0",
20+
"vue-custom-context-menu": "^3.0.1",
2021
"vue-drag-resize": "^1.3.2",
22+
"vue-draggable-nested-tree": "^2.2.17",
2123
"vue-draggable-resizable": "^2.0.0-rc2",
2224
"vue-loader": "^15.7.0",
2325
"vue-multiselect": "^2.1.6",
2426
"vue-prism-editor": "^0.2.1",
2527
"vued3tree": "^3.7.1",
28+
"vuedraggable": "^2.23.0",
2629
"vuex": "^3.1.1"
2730
},
2831
"devDependencies": {

quasar.conf.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,21 @@ module.exports = function (ctx) {
5353
'QTab',
5454
'QRouteTab',
5555
'QTabPanels',
56+
'QDialog',
57+
'QSelect',
5658
'QTabPanel',
5759
'QFab',
58-
'QFabAction'
60+
'QFabAction',
61+
'QMenu',
62+
'QUploader',
63+
'QEditor',
64+
'QCard',
65+
'QChip'
5966
],
6067

6168
directives: [
62-
'Ripple'
69+
'Ripple',
70+
'ClosePopup'
6371
],
6472

6573
// Quasar plugins
@@ -78,15 +86,15 @@ module.exports = function (ctx) {
7886
// analyze: true,
7987
// extractCSS: false,
8088
extendWebpack (cfg) {
81-
// cfg.module.rules.push({
89+
//cfg.module.rules.push({
8290
// enforce: 'pre',
8391
// test: /\.(js|vue)$/,
8492
// loader: 'eslint-loader',
8593
// exclude: /node_modules/,
8694
// options: {
8795
// formatter: require('eslint').CLIEngine.getFormatter('stylish')
8896
// }
89-
// })
97+
//})
9098
}
9199
},
92100

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<template>
2+
<div id="child-select">
3+
<br />
4+
<multiselect
5+
id="dropdown"
6+
placeholder="Select child components"
7+
:multiple="true"
8+
:close-on-select="false"
9+
:options="options"
10+
:value="componentChildrenMultiselectValue"
11+
@input="handleSelect"
12+
:max-height="150"
13+
:option-height="20"
14+
:searchable="false"
15+
></multiselect>
16+
<!-- <q-select
17+
:options="options"
18+
label="Select children"
19+
multiple
20+
/> -->
21+
</div>
22+
</template>
23+
24+
<script>
25+
import { mapState, mapActions } from 'vuex'
26+
import Multiselect from 'vue-multiselect'
27+
28+
export default {
29+
components: {
30+
Multiselect
31+
},
32+
computed: {
33+
...mapState([
34+
'routes',
35+
// comes from store/state/index.js
36+
'componentMap',
37+
'activeComponent',
38+
'componentChildrenMultiselectValue',
39+
'modalOpen'
40+
]),
41+
options () {
42+
const routes = Object.keys(this.routes)
43+
const exceptions = new Set(['App', this.activeComponent, ...routes])
44+
console.log('exceptions', exceptions)
45+
return Object.keys(this.componentMap).filter(component => {
46+
if (!exceptions.has(component)) return component
47+
})
48+
}
49+
},
50+
methods: {
51+
...mapActions([
52+
'updateComponentChildrenMultiselectValue',
53+
'updateActiveComponentChildrenValue'
54+
]),
55+
//
56+
handleSelect (value) {
57+
// if (this.modalOpen) this.updateActiveComponentChildrenValue(value)
58+
console.log('Multiselect: ', value)
59+
this.updateActiveComponentChildrenValue(value)
60+
this.updateComponentChildrenMultiselectValue(value)
61+
}
62+
}
63+
}
64+
</script>
65+
66+
<!-- New step!
67+
Add Multiselect CSS. Can be added as a static asset or inside a component. -->
68+
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
69+
<style scoped>
70+
#child-select {
71+
min-width: 300px;
72+
min-height: 200px;
73+
}
74+
</style>

src/components/CodeSnippet.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
language="js"
88
:line-numbers="lineNumbers"
99
class="code-editor"
10-
:style="{ height: `${height}vh` }"
10+
:style="{ height: `${height}vh`}"
11+
readonly="true"
1112
/>
1213
</div>
1314
</template>
@@ -43,7 +44,7 @@ export default {
4344
// calls createTemplate and createBoiler to generate snippet
4445
createCodeSnippet (componentName, children) {
4546
let result = `${this.createTemplate(componentName, children)}${this.createBoiler(componentName, children)}`
46-
console.log(`createCodeSnippet result: ${result}`)
47+
//console.log(`createCodeSnippet result: ${result}`)
4748
return result
4849
},
4950
createTemplate (componentName, children) {
@@ -57,7 +58,7 @@ export default {
5758
return `<template>\n ${output}${templateTagStr} </div>\n</template>`
5859
},
5960
writeTemplateTag (componentName) {
60-
console.log('writeTemplateTag invoked!')
61+
//console.log('writeTemplateTag invoked!')
6162
// create reference object
6263
const htmlElementMap = {
6364
div: ['<div>', '</div>'],
@@ -81,7 +82,7 @@ export default {
8182
outputStr += htmlElementMap[el.text][1]
8283
outputStr += ` \n`
8384
}
84-
console.log(`outputStr from writeTemplateTag: ${outputStr}`)
85+
//console.log(`outputStr from writeTemplateTag: ${outputStr}`)
8586
return outputStr
8687
},
8788
createBoiler (componentName, children) {
@@ -109,7 +110,7 @@ export default {
109110
},
110111
// updates code snippet, but broken cause children undefined, shows `function () { [native code] }`
111112
updated () {
112-
console.log(`code: ${this.createCodeSnippet(this.activeComponent, this.componentMap[this.activeComponent].children)}`)
113+
//console.log(`code: ${this.createCodeSnippet(this.activeComponent, this.componentMap[this.activeComponent].children)}`)
113114
this.code = `${this.createCodeSnippet(this.activeComponent, this.componentMap[this.activeComponent].children)}`
114115
},
115116
beforeDestroy () {
@@ -121,5 +122,6 @@ export default {
121122
<style lang="stylus" scoped>
122123
// resize handled by vue lifecycle methods
123124
.code-editor {
125+
font-size: 11px;
124126
}
125127
</style>

0 commit comments

Comments
 (0)