mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 22:43:34 -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"
|
||||
@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>
|
||||
<!--
|
||||
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 { useNavigationWarning } from "~/composables/use-navigation-warning";
|
||||
|
||||
const EDITOR_OPTIONS = {
|
||||
mode: "code",
|
||||
search: false,
|
||||
mainMenuBar: false,
|
||||
};
|
||||
|
||||
const recipe = defineModel<NoUndefinedField<Recipe>>({ required: true });
|
||||
|
||||
const { $vuetify } = useNuxtApp();
|
||||
|
|
|
@ -56,16 +56,12 @@
|
|||
v-model="debugTreeView"
|
||||
:label="$t('recipe.tree-view')"
|
||||
/>
|
||||
<LazyRecipeJsonEditor
|
||||
<RecipeJsonEditor
|
||||
v-model="debugData"
|
||||
class="primary"
|
||||
:options="{
|
||||
mode: debugTreeView ? 'tree' : 'code',
|
||||
search: false,
|
||||
indentation: 4,
|
||||
mainMenuBar: false,
|
||||
}"
|
||||
height="700px"
|
||||
:mode="debugTreeView ? 'tree' : 'text'"
|
||||
:main-menu-bar="false"
|
||||
:read-only="true"
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
|
|
|
@ -24,12 +24,13 @@
|
|||
class="mt-2"
|
||||
@change="handleIsEditJson"
|
||||
/>
|
||||
<LazyRecipeJsonEditor
|
||||
<RecipeJsonEditor
|
||||
v-if="isEditJSON"
|
||||
v-model="newRecipeData"
|
||||
height="250px"
|
||||
class="mt-10"
|
||||
:options="EDITOR_OPTIONS"
|
||||
mode="code"
|
||||
:main-menu-bar="false"
|
||||
/>
|
||||
<v-textarea
|
||||
v-else
|
||||
|
@ -79,12 +80,6 @@ import { useUserApi } from "~/composables/api";
|
|||
import { validators } from "~/composables/use-validators";
|
||||
import type { VForm } from "~/types/auto-forms";
|
||||
|
||||
const EDITOR_OPTIONS = {
|
||||
mode: "code",
|
||||
search: false,
|
||||
mainMenuBar: false,
|
||||
};
|
||||
|
||||
export default defineNuxtComponent({
|
||||
setup() {
|
||||
const state = reactive({
|
||||
|
@ -176,7 +171,6 @@ export default defineNuxtComponent({
|
|||
}
|
||||
|
||||
return {
|
||||
EDITOR_OPTIONS,
|
||||
domUrlForm,
|
||||
importKeywordsAsTags,
|
||||
stayInEditMode,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue