BlockTemplate.vue 1.13 KB
Newer Older
1
2
<template>
  <div class="block">
3
    <div class="heading" :draggable="dragEnabled.value" @dragstart="startDrag($event, row, col)" @dragend.prevent="stopDrag()">
4
5
6
7
8
9
10
11
12
13
      <h2>{{ heading }}</h2>
    </div>
    <div class="content">
      <slot/>
    </div>
  </div>
</template>

<script>
export default {
14
15
16
  props: [ 'heading', 'row', 'col' ],

  inject: [ 'dragEnabled', 'startDrag', 'stopDrag' ]
17
18
19
20
21
22
23
24
25
}
</script>

<style lang="scss">
  $padding: 20px;

  .block {
    width: 100%;
    height: 100%;
26
    min-width: 150px;
27
    text-align: left;
28
29
    display: flex;
    flex-direction: column;
30
31
32
33
34
  }

  .heading {
    color: $lightest-theme-color;
    background-color: $theme-color;
35
    cursor: move;
36
37
38
39
40
41
42
43

    h2 {
      padding: 10px $padding;
      margin: 0;
    }
  }

  .content {
44
    padding: 0;
45
    overflow-y: auto;
46
47
48
49
50
  }

  ul {
    list-style-type: none;
    padding: 0;
51
52
53
54
55
56
    margin: 0 !important;
  }

  li {
    padding: 0 $padding;
    padding-top: $padding / 2;
57
58
59
  }

  hr {
60
61
62
63
    border: none;
    background-color: $theme-color;
    color: $theme-color;
    height: 1px;
64
65
    margin-left: -$padding;
    margin-right: -$padding;
66
    margin-bottom: 0;
67
68
  }
</style>