mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-23 06:45:22 -07:00
fix draggable instructions, kind of
This commit is contained in:
parent
7a4e690082
commit
d09dc2b740
1 changed files with 18 additions and 5 deletions
|
@ -137,7 +137,7 @@
|
||||||
:name="!drag ? 'flip-list' : ''"
|
:name="!drag ? 'flip-list' : ''"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-for="(step, index) in modelValue"
|
v-for="(step, index) in instructionList"
|
||||||
:key="step.id!"
|
:key="step.id!"
|
||||||
class="list-group-item"
|
class="list-group-item"
|
||||||
>
|
>
|
||||||
|
@ -499,10 +499,23 @@ export default defineNuxtComponent({
|
||||||
showTitleEditor.value = temp;
|
showTitleEditor.value = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
const instructionList = computed({
|
const instructionList = ref<RecipeStep[]>([...props.modelValue]);
|
||||||
get: () => props.modelValue,
|
|
||||||
set: (value: RecipeStep[]) => context.emit("update:modelValue", value),
|
watch(
|
||||||
});
|
() => props.modelValue,
|
||||||
|
(newVal) => {
|
||||||
|
instructionList.value = [...newVal];
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
instructionList,
|
||||||
|
(newVal) => {
|
||||||
|
context.emit("update:modelValue", [...newVal]);
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
|
||||||
// ===============================================================
|
// ===============================================================
|
||||||
// Ingredient Linker
|
// Ingredient Linker
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue