OtherNodes.vue 1.19 KB
Newer Older
Adam Procter's avatar
Adam Procter committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<template>
  <div v-for="(nodes, index) in otherArray" :key="index">
    <p
      class="readmode"
      :id="nodes.node_id"
      :inner-html.prop="nodes.node_text"
    ></p>
  </div>
</template>

<script>
// @ is an alias to /src
import { mapState } from 'vuex'

// import marked from 'marked'

export default {
  name: 'OtherNodes',

  data() {
    return {
      otherArray: [],
    }
  },

  computed: {
    ...mapState({
      otherNodes: (state) => state.otherNodes,
    }),
  },

  // watch: {
  //   added: function () {
  //     this.loadData()
  //   },
  // },

  mounted() {
    //console.log('mounted')
    setTimeout(this.loadData, 500)

    // if (localStorage.nogg_microcosm) {
    //   // var devicename = localStorage.nogg_name
    //   var microcosm = localStorage.nogg_microcosm
    //   this.$store.dispatch('setMicrocosm', { microcosm })
    // } else {
    //   console.log('no')
    //   // go home
    // }
  },

  methods: {
    loadData() {
      var othersFiltered = this.otherNodes.otherNodes.filter(
        (nodes) => nodes.node_deleted == false
      )
      this.$store.dispatch('getOthernodes')
      this.otherArray = othersFiltered
    },
  },
}
</script>

<style scoped></style>