Put ref in v-show so Vue can pick it up on mount, toggle JSON show on click (#1045)

This commit is contained in:
Hilmar Palsson 2022-05-21 20:11:11 +01:00 committed by GitHub
parent e3e7230359
commit 5c7cf5f334
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,19 +13,19 @@
<RecipePageActionMenu <RecipePageActionMenu
logged-in logged-in
:value="true" :value="true"
@json="jsonEditor = true" @json="jsonEditor = !jsonEditor"
@edit="jsonEditor = false" @edit="jsonEditor = !jsonEditor"
@save="createRecipe" @save="createRecipe"
/> />
<div v-if="jsonEditor"> <div v-show="jsonEditor">
<!-- Probably not the best way, but it works! --> <!-- Probably not the best way, but it works! -->
<br /> <br />
<br /> <br />
<VJsoneditor v-model="recipeDetails" height="1500px" :options="jsonEditorOptions" /> <VJsoneditor v-model="recipeDetails" height="1500px" :options="jsonEditorOptions" />
</div> </div>
<RecipeEditor ref="recipeEditor" v-else v-model="recipeDetails" @upload="getImage" /> <RecipeEditor ref="recipeEditor" v-show="!jsonEditor" v-model="recipeDetails" @upload="getImage" />
</v-card> </v-card>
</v-container> </v-container>
</template> </template>