Collect.vue 856 Bytes
Newer Older
1
2
<template>
  <ToolBar @added-node="addedNode" />
Adam Procter's avatar
Adam Procter committed
3
  <MyNodes :added="added" />
4
5
6
7
8
</template>

<script>
// @ is an alias to /src
import ToolBar from '@/components/ToolBar.vue'
9
import MyNodes from '@/components/MyNodes.vue'
10
11
12
13

export default {
  mounted() {
    this.$store.dispatch('getMicrocosm')
14
15
    // register, i.e. in a `beforeDestroy` hook
    window.addEventListener('unload', this.someMethod)
16
17
18
19
20
  },
  name: 'Collect',

  components: {
    ToolBar,
21
    MyNodes,
22
23
24
25
  },

  data() {
    return {
Adam Procter's avatar
Adam Procter committed
26
      added: false,
27
28
29
    }
  },

Adam Procter's avatar
Adam Procter committed
30
  methods: {
31
    addedNode() {
Adam Procter's avatar
Adam Procter committed
32
      this.added = !this.added
33
    },
34
35
36
37
38
39
40
41
    someMethod() {
      localStorage.removeItem('nogg_microcosm')
      localStorage.removeItem('nogg_name')

      location.assign(
        process.env.VUE_APP_HTTP + '://' + process.env.VUE_APP_URL + '/'
      )
    },
42
43
44
45
46
  },
}
</script>

<style scoped></style>