mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
update cookbookEditor and remove unused props
This commit is contained in:
parent
436a24f8b2
commit
96320d9f36
3 changed files with 45 additions and 72 deletions
|
@ -44,36 +44,20 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ReadCookBook } from "~/lib/api/types/cookbook";
|
|
||||||
import { Organizer } from "~/lib/api/types/non-generated";
|
import { Organizer } from "~/lib/api/types/non-generated";
|
||||||
import QueryFilterBuilder from "~/components/Domain/QueryFilterBuilder.vue";
|
import QueryFilterBuilder from "~/components/Domain/QueryFilterBuilder.vue";
|
||||||
import type { FieldDefinition } from "~/composables/use-query-filter-builder";
|
import type { FieldDefinition } from "~/composables/use-query-filter-builder";
|
||||||
|
import type { ReadCookBook } from "~/lib/api/types/cookbook";
|
||||||
|
|
||||||
export default defineNuxtComponent({
|
const modelValue = defineModel<ReadCookBook>({ required: true });
|
||||||
components: { QueryFilterBuilder },
|
const i18n = useI18n();
|
||||||
props: {
|
const cookbook = toRef(modelValue);
|
||||||
modelValue: {
|
function handleInput(value: string | undefined) {
|
||||||
type: Object as () => ReadCookBook,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
type: Object as () => any,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
emits: ["update:modelValue"],
|
|
||||||
setup(props, { emit }) {
|
|
||||||
const i18n = useI18n();
|
|
||||||
|
|
||||||
const cookbook = toRef(() => props.modelValue);
|
|
||||||
|
|
||||||
function handleInput(value: string | undefined) {
|
|
||||||
cookbook.value.queryFilterString = value || "";
|
cookbook.value.queryFilterString = value || "";
|
||||||
emit("update:modelValue", cookbook.value);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const fieldDefs: FieldDefinition[] = [
|
const fieldDefs: FieldDefinition[] = [
|
||||||
{
|
{
|
||||||
name: "recipe_category.id",
|
name: "recipe_category.id",
|
||||||
label: i18n.t("category.categories"),
|
label: i18n.t("category.categories"),
|
||||||
|
@ -109,13 +93,5 @@ export default defineNuxtComponent({
|
||||||
label: i18n.t("general.date-updated"),
|
label: i18n.t("general.date-updated"),
|
||||||
type: "date",
|
type: "date",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return {
|
|
||||||
cookbook,
|
|
||||||
handleInput,
|
|
||||||
fieldDefs,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<CookbookEditor
|
<CookbookEditor
|
||||||
v-model="editTarget"
|
v-model="editTarget"
|
||||||
:actions="actions"
|
|
||||||
/>
|
/>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</BaseDialog>
|
</BaseDialog>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
@cancel="deleteCreateTarget()"
|
@cancel="deleteCreateTarget()"
|
||||||
>
|
>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<CookbookEditor :key="createTargetKey" v-model="createTarget" :actions="actions" />
|
<CookbookEditor :key="createTargetKey" v-model="createTarget" />
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</BaseDialog>
|
</BaseDialog>
|
||||||
|
|
||||||
|
@ -105,9 +105,7 @@
|
||||||
<v-expansion-panel-text>
|
<v-expansion-panel-text>
|
||||||
<CookbookEditor
|
<CookbookEditor
|
||||||
v-model="myCookbooks[index]"
|
v-model="myCookbooks[index]"
|
||||||
:actions="actions"
|
|
||||||
:collapsable="false"
|
:collapsable="false"
|
||||||
@delete="deleteEventHandler"
|
|
||||||
/>
|
/>
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue