Kit.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <div class="kit">
  3. <kit-list @open-node="openNode" />
  4. <kit-view
  5. v-if="sheet !== null"
  6. :sheet="sheet"
  7. @close-node="closeNode"
  8. @open-node="openLibrary"
  9. />
  10. </div>
  11. </template>
  12. <script>
  13. import { mapGetters } from 'vuex'
  14. import { KitList, KitView } from '@/pages/kit'
  15. export default {
  16. name: 'Kit',
  17. components: {
  18. KitList,
  19. KitView
  20. },
  21. data () {
  22. return {
  23. }
  24. },
  25. computed: {
  26. ...mapGetters(['sheet'])
  27. },
  28. methods: {
  29. openNode (id) {
  30. this.$store.dispatch('OPEN_KIT_NODE', id)
  31. },
  32. openLibrary (ids) {
  33. this.$store.dispatch('OPEN_NODE', ids)
  34. this.$store.dispatch('CLOSE_KIT_NODE')
  35. },
  36. closeNode () {
  37. this.$store.dispatch('CLOSE_KIT_NODE')
  38. }
  39. },
  40. created () {
  41. this.$store.dispatch('INIT_KIT')
  42. }
  43. }
  44. </script>
  45. <style lang="scss" scoped>
  46. .kit {
  47. height: 100%;
  48. width: 100%;
  49. &-view {
  50. position: relative;
  51. margin-bottom: -100%;
  52. // compensate header border
  53. height: calc(100% + 2px);
  54. top: calc(-100% - 2px);
  55. @include media-breakpoint-down($layout-bp-down) {
  56. margin-bottom: -100vh;
  57. }
  58. }
  59. }
  60. </style>