Sun Nov 04 2018
Copied to clipboard! Copy reply
  • 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
<template>
  <section class="container">
    <Nav />
    <Tabs />
    <div class="date">{{ $store.state.paste.date }}</div>
    <div class="contents">
      <Lines />
      <Code v-if="$store.state.mode == 'view'" />
      <Textarea v-else />
    </div>
  </section>
</template>

<script>
  // try this, pages have index.vue and _index.vue. index.vue import _index.vue

  import Nav from '~/components/Nav.vue'
  import Tabs from '~/components/Tabs.vue'
  import Lines from '~/components/Lines.vue'
  import Code from '~/components/Code.vue'
  import Textarea from '~/components/Textarea.vue'

  export default {
    components: {
      Nav,
      Tabs,
      Lines,
      Code,
      Textarea
    },
   
    beforeMount ()
    {
      // Reset state, in case user got here without reloading
      this.$store.commit('UPDATE_ENTRIES', [])   
      this.$store.commit('SET_ACTIVE_ENTRY', 0)       
      this.$store.commit('SET_MODE', 'edit')       
      this.$store.commit('SET_LINE_COUNT', 0)
    }    
  }
</script>

<style lang='stylus'>
  section
    height 100%
</style>