mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-23 06:45:22 -07:00
migrate JSON editor usage
This commit is contained in:
parent
6ce9f66693
commit
7644aa5ffa
3 changed files with 14 additions and 24 deletions
|
@ -9,7 +9,13 @@
|
||||||
@save="saveRecipe"
|
@save="saveRecipe"
|
||||||
@delete="deleteRecipe"
|
@delete="deleteRecipe"
|
||||||
/>
|
/>
|
||||||
<LazyRecipeJsonEditor v-if="isEditJSON" v-model="recipe" class="mt-10" :options="EDITOR_OPTIONS" />
|
<RecipeJsonEditor
|
||||||
|
v-if="isEditJSON"
|
||||||
|
v-model="recipe"
|
||||||
|
class="mt-10"
|
||||||
|
mode="text"
|
||||||
|
:main-menu-bar="false"
|
||||||
|
/>
|
||||||
<v-card-text v-else>
|
<v-card-text v-else>
|
||||||
<!--
|
<!--
|
||||||
This is where most of the main content is rendered. Some components include state for both Edit and View modes
|
This is where most of the main content is rendered. Some components include state for both Edit and View modes
|
||||||
|
@ -177,12 +183,6 @@ import RecipeDialogBulkAdd from "~/components/Domain/Recipe/RecipeDialogBulkAdd.
|
||||||
import RecipeNotes from "~/components/Domain/Recipe/RecipeNotes.vue";
|
import RecipeNotes from "~/components/Domain/Recipe/RecipeNotes.vue";
|
||||||
import { useNavigationWarning } from "~/composables/use-navigation-warning";
|
import { useNavigationWarning } from "~/composables/use-navigation-warning";
|
||||||
|
|
||||||
const EDITOR_OPTIONS = {
|
|
||||||
mode: "code",
|
|
||||||
search: false,
|
|
||||||
mainMenuBar: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
const recipe = defineModel<NoUndefinedField<Recipe>>({ required: true });
|
const recipe = defineModel<NoUndefinedField<Recipe>>({ required: true });
|
||||||
|
|
||||||
const { $vuetify } = useNuxtApp();
|
const { $vuetify } = useNuxtApp();
|
||||||
|
|
|
@ -56,16 +56,12 @@
|
||||||
v-model="debugTreeView"
|
v-model="debugTreeView"
|
||||||
:label="$t('recipe.tree-view')"
|
:label="$t('recipe.tree-view')"
|
||||||
/>
|
/>
|
||||||
<LazyRecipeJsonEditor
|
<RecipeJsonEditor
|
||||||
v-model="debugData"
|
v-model="debugData"
|
||||||
class="primary"
|
|
||||||
:options="{
|
|
||||||
mode: debugTreeView ? 'tree' : 'code',
|
|
||||||
search: false,
|
|
||||||
indentation: 4,
|
|
||||||
mainMenuBar: false,
|
|
||||||
}"
|
|
||||||
height="700px"
|
height="700px"
|
||||||
|
:mode="debugTreeView ? 'tree' : 'text'"
|
||||||
|
:main-menu-bar="false"
|
||||||
|
:read-only="true"
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -24,12 +24,13 @@
|
||||||
class="mt-2"
|
class="mt-2"
|
||||||
@change="handleIsEditJson"
|
@change="handleIsEditJson"
|
||||||
/>
|
/>
|
||||||
<LazyRecipeJsonEditor
|
<RecipeJsonEditor
|
||||||
v-if="isEditJSON"
|
v-if="isEditJSON"
|
||||||
v-model="newRecipeData"
|
v-model="newRecipeData"
|
||||||
height="250px"
|
height="250px"
|
||||||
class="mt-10"
|
class="mt-10"
|
||||||
:options="EDITOR_OPTIONS"
|
mode="code"
|
||||||
|
:main-menu-bar="false"
|
||||||
/>
|
/>
|
||||||
<v-textarea
|
<v-textarea
|
||||||
v-else
|
v-else
|
||||||
|
@ -79,12 +80,6 @@ import { useUserApi } from "~/composables/api";
|
||||||
import { validators } from "~/composables/use-validators";
|
import { validators } from "~/composables/use-validators";
|
||||||
import type { VForm } from "~/types/auto-forms";
|
import type { VForm } from "~/types/auto-forms";
|
||||||
|
|
||||||
const EDITOR_OPTIONS = {
|
|
||||||
mode: "code",
|
|
||||||
search: false,
|
|
||||||
mainMenuBar: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default defineNuxtComponent({
|
export default defineNuxtComponent({
|
||||||
setup() {
|
setup() {
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
@ -176,7 +171,6 @@ export default defineNuxtComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
EDITOR_OPTIONS,
|
|
||||||
domUrlForm,
|
domUrlForm,
|
||||||
importKeywordsAsTags,
|
importKeywordsAsTags,
|
||||||
stayInEditMode,
|
stayInEditMode,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue