Skip to content
Snippets Groups Projects
Commit 6d35e9d1 authored by Adam Procter's avatar Adam Procter
Browse files

Merge branch 'vuex'

parents 604b4326 60ead396
No related branches found
No related tags found
No related merge requests found
<template> <template>
<div class="node" ref="nodes"> <div ref="nodes" class="node" v-bind:id="nodeid">
<form id="editForm" class="myScroll"> <form id="editForm" class="myScroll">
<textarea></textarea> <textarea v-model="nodetext"></textarea>
<p>markdown supported</p> <p>markdown supported</p>
<button>delete</button> <button>delete</button>
</form> </form>
...@@ -9,26 +9,32 @@ ...@@ -9,26 +9,32 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex'
import { drag } from './mixins/drag.js' import { drag } from './mixins/drag.js'
export default { export default {
name: 'NodesLayer', name: 'NodesLayer',
mixins: [drag], mixins: [drag],
// FIXME : these probably need to be data/ computed and not props
// as will be editable
props: { nodetext: String, nodeid: Number },
// data() {
// return {
//
// }
// },
mounted() { mounted() {
var nodes = this.$refs.nodes var nodes = this.$refs.nodes
this.makeDraggable(nodes) this.makeDraggable(nodes)
}, },
methods: { methods: {
setFocus() { setFocus() {
this.$refs.notetext.focus() this.$refs.nodetext.focus()
}, },
editNodeText() {}, editNodeText() {},
deleteFlag() {} deleteFlag() {}
}, }
computed: mapState({})
} }
</script> </script>
......
...@@ -20,7 +20,11 @@ export default new Vuex.Store({ ...@@ -20,7 +20,11 @@ export default new Vuex.Store({
width: 10, width: 10,
fill: 'black' fill: 'black'
}, },
configNodes: {} configNodes: [
{ id: 1, text: 'node 1' },
{ id: 2, text: 'node 2' },
{ id: 3, text: 'node 3' }
]
}, },
mutations: {}, mutations: {},
actions: {}, actions: {},
......
<template> <template>
<div class="home"> <div class="home">
<!-- The number of NodesLayers comes from store --> <!-- The number of NodesLayers comes from store -->
<NodesLayer /> <NodesLayer
<NodesLayer /> v-for="(value, index) in configNodes"
v-bind:key="index"
v-bind:nodeid="value.id"
v-bind:nodetext="value.text"
/>
<CanvasLayer /> <CanvasLayer />
<ControlsLayer /> <ControlsLayer />
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment