File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
personalization-webcomponents/src/components Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 4
4
:list =" modelValue"
5
5
tag =" ul"
6
6
class =" list"
7
- :animation =" 200"
8
- :handle =" isDraggable ? '.drag-handle' : undefined"
9
- :disabled =" !isDraggable"
7
+ :options =" sortableOptions"
10
8
@start =" drag = true"
11
9
@end =" drag = false"
12
- :ghost-class =" 'drag-ghost'"
13
10
item-key =" serviceID"
14
11
>
15
12
<template #item =" { element } " >
@@ -66,9 +63,9 @@ import type DummyChecklistItem from "@/api/dummyservice/DummyChecklistItem.ts";
66
63
67
64
import { MucIcon } from " @muenchen/muc-patternlab-vue" ;
68
65
import { Sortable } from " sortablejs-vue3" ;
69
- import { defineEmits , ref } from " vue" ;
66
+ import {computed , defineEmits , ref } from " vue" ;
70
67
71
- withDefaults (
68
+ const props = withDefaults (
72
69
defineProps <{
73
70
modelValue: DummyChecklistItem [];
74
71
isDraggable? : boolean ;
@@ -82,6 +79,13 @@ withDefaults(
82
79
const emit = defineEmits ([" checked" , " label-click" ]);
83
80
const drag = ref (false );
84
81
82
+ const sortableOptions = computed (() => ({
83
+ animation: 200 ,
84
+ handle: props .isDraggable ? " .drag-handle" : undefined ,
85
+ ghostClass: " drag-ghost" ,
86
+ disabled: ! props .isDraggable
87
+ }));
88
+
85
89
const dialogVisible = ref (false );
86
90
const dialogItem = ref <DummyChecklistItem | null >(null );
87
91
You can’t perform that action at this time.
0 commit comments