Skip to content
Snippets Groups Projects
OtherNodes.vue 799 B
<template>
  <div
    class="nodes"
    v-for="(nodes, index) in otherNodes.otherNodes"
    :key="index"
  >
    <p class="readmode" :id="nodes.id">
      {{ nodes.text }}
    </p>
  </div>
</template>

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

// import marked from 'marked'

export default {
  name: 'OtherNodes',

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

  mounted() {
    this.$store.dispatch('getOthernodes')
    setTimeout(this.loadData, 500)
    setInterval(this.loadData, 5000)
  },

  methods: {
    loadData() {
      this.$store.dispatch('setOthernodes')
    },
  },
}
</script>

<style scoped>
.nodes {
  width: 95%;

  background-color: rgb(155, 194, 216);
  margin-top: 1em;
  margin-left: 0.5em;
}
</style>