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
logged-in
:value="true"
@json="jsonEditor = true"
@edit="jsonEditor = false"
@json="jsonEditor = !jsonEditor"
@edit="jsonEditor = !jsonEditor"
@save="createRecipe"
/>
<div v-if="jsonEditor">
<div v-show="jsonEditor">
<!-- Probably not the best way, but it works! -->
<br />
<br />
<VJsoneditor v-model="recipeDetails" height="1500px" :options="jsonEditorOptions" />
</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-container>
</template>