Blame view
src/components/Kanban/index.vue
1.85 KB
d7d9c38c2 auto commit the c... |
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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
<template> <div class="board-column"> <div class="board-column-header"> {{ headerText }} </div> <draggable :list="list" v-bind="$attrs" class="board-column-content" :set-data="setData" > <div v-for="element in list" :key="element.id" class="board-item"> {{ element.name }} {{ element.id }} </div> </draggable> </div> </template> <script> import draggable from 'vuedraggable' export default { name: 'DragKanbanDemo', components: { draggable }, props: { headerText: { type: String, default: 'Header' }, options: { type: Object, default() { return {} } }, list: { type: Array, default() { return [] } } }, methods: { setData(dataTransfer) { // to avoid Firefox bug // Detail see : https://github.com/RubaXa/Sortable/issues/1012 dataTransfer.setData('Text', '') } } } </script> <style lang="scss" scoped> .board-column { min-width: 300px; min-height: 100px; height: auto; overflow: hidden; background: #f0f0f0; border-radius: 3px; .board-column-header { height: 50px; line-height: 50px; overflow: hidden; padding: 0 20px; text-align: center; background: #333; color: #fff; border-radius: 3px 3px 0 0; } .board-column-content { height: auto; overflow: hidden; border: 10px solid transparent; min-height: 60px; display: flex; justify-content: flex-start; flex-direction: column; align-items: center; .board-item { cursor: pointer; width: 100%; height: 64px; margin: 5px 0; background-color: #fff; text-align: left; line-height: 54px; padding: 5px 10px; box-sizing: border-box; box-shadow: 0px 1px 3px 0 rgba(0, 0, 0, 0.2); } } } </style> |