fix: delete column
This commit is contained in:
parent
c01fa6d248
commit
c7e3e1d486
@ -8,9 +8,10 @@
|
|||||||
>
|
>
|
||||||
<template #item="{ element: column }">
|
<template #item="{ element: column }">
|
||||||
<div
|
<div
|
||||||
|
v-if="!column.delete"
|
||||||
class="flex flex-col gap-2.5 min-w-[268px] hover:bg-gray-100 rounded-lg p-2.5 transition-all duration-300 ease-in-out"
|
class="flex flex-col gap-2.5 min-w-[268px] hover:bg-gray-100 rounded-lg p-2.5 transition-all duration-300 ease-in-out"
|
||||||
>
|
>
|
||||||
<div class="flex gap-2 items-center justify-between">
|
<div class="flex gap-2 items-center group justify-between">
|
||||||
<div class="flex items-center text-base">
|
<div class="flex items-center text-base">
|
||||||
<NestedPopover>
|
<NestedPopover>
|
||||||
<template #target>
|
<template #target>
|
||||||
@ -47,7 +48,16 @@
|
|||||||
</NestedPopover>
|
</NestedPopover>
|
||||||
<div>{{ column.column.name }}</div>
|
<div>{{ column.column.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="flex">
|
||||||
|
<Dropdown :options="actions(column)">
|
||||||
|
<template #default>
|
||||||
|
<Button
|
||||||
|
class="hidden group-hover:flex"
|
||||||
|
icon="more-horizontal"
|
||||||
|
variant="ghost"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</Dropdown>
|
||||||
<Button icon="plus" variant="ghost" />
|
<Button icon="plus" variant="ghost" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -75,6 +85,7 @@
|
|||||||
import NestedPopover from '@/components/NestedPopover.vue'
|
import NestedPopover from '@/components/NestedPopover.vue'
|
||||||
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
|
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
|
||||||
import Draggable from 'vuedraggable'
|
import Draggable from 'vuedraggable'
|
||||||
|
import { Dropdown } from 'frappe-ui'
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
|
||||||
const emit = defineEmits(['update'])
|
const emit = defineEmits(['update'])
|
||||||
@ -95,9 +106,29 @@ const columns = computed(() => {
|
|||||||
return _columns
|
return _columns
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function actions(column) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
group: __('Options'),
|
||||||
|
hideLabel: true,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
label: __('Delete'),
|
||||||
|
icon: 'trash-2',
|
||||||
|
onClick: () => {
|
||||||
|
column['delete'] = true
|
||||||
|
updateColumn()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
function updateColumn() {
|
function updateColumn() {
|
||||||
let _columns = []
|
let _columns = []
|
||||||
columns.value.forEach((col) => {
|
columns.value.forEach((col) => {
|
||||||
|
if (col.delete) return
|
||||||
_columns.push(col.column)
|
_columns.push(col.column)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user