Skip to content

Commit 81db1c3

Browse files
committed
docs(vue): add surrounding code
1 parent a9c2c52 commit 81db1c3

File tree

2 files changed

+62
-16
lines changed

2 files changed

+62
-16
lines changed

docs/vue/your-first-app/7-live-reload.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,37 @@ const showActionSheet = async (photo: UserPhoto) => {
140140
Add a click handler to the `<ion-img>` element. When the app user taps on a photo in our gallery, we’ll display an [Action Sheet](../../api/action-sheet.md) dialog with the option to either delete the selected photo or cancel (close) the dialog.
141141

142142
```vue
143-
<ion-grid>
144-
<ion-row>
145-
<ion-col size="6" :key="photo.filepath" v-for="photo in photos">
146-
<!-- CHANGE: Add a click event listener to each image. -->
147-
<ion-img :src="photo.webviewPath" @click="showActionSheet(photo)"></ion-img>
148-
</ion-col>
149-
</ion-row>
150-
</ion-grid>
143+
<template>
144+
<ion-page>
145+
<ion-header>
146+
<ion-toolbar>
147+
<ion-title>Photo Gallery</ion-title>
148+
</ion-toolbar>
149+
</ion-header>
150+
<ion-content :fullscreen="true">
151+
<ion-header collapse="condense">
152+
<ion-toolbar>
153+
<ion-title size="large">Photo Gallery</ion-title>
154+
</ion-toolbar>
155+
</ion-header>
156+
157+
<ion-grid>
158+
<ion-row>
159+
<ion-col size="6" :key="photo.filepath" v-for="photo in photos">
160+
<!-- CHANGE: Add a click event listener to each image. -->
161+
<ion-img :src="photo.webviewPath" @click="showActionSheet(photo)"></ion-img>
162+
</ion-col>
163+
</ion-row>
164+
</ion-grid>
165+
166+
<ion-fab vertical="bottom" horizontal="center" slot="fixed">
167+
<ion-fab-button @click="addNewToGallery()">
168+
<ion-icon :icon="camera"></ion-icon>
169+
</ion-fab-button>
170+
</ion-fab>
171+
</ion-content>
172+
</ion-page>
173+
</template>
151174
```
152175

153176
Remember that removing the photo from the `photos` array triggers the `cachePhotos` method for us automatically.

versioned_docs/version-v7/vue/your-first-app/7-live-reload.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,37 @@ const showActionSheet = async (photo: UserPhoto) => {
140140
Add a click handler to the `<ion-img>` element. When the app user taps on a photo in our gallery, we’ll display an [Action Sheet](../../api/action-sheet.md) dialog with the option to either delete the selected photo or cancel (close) the dialog.
141141

142142
```vue
143-
<ion-grid>
144-
<ion-row>
145-
<ion-col size="6" :key="photo.filepath" v-for="photo in photos">
146-
<!-- CHANGE: Add a click event listener to each image. -->
147-
<ion-img :src="photo.webviewPath" @click="showActionSheet(photo)"></ion-img>
148-
</ion-col>
149-
</ion-row>
150-
</ion-grid>
143+
<template>
144+
<ion-page>
145+
<ion-header>
146+
<ion-toolbar>
147+
<ion-title>Photo Gallery</ion-title>
148+
</ion-toolbar>
149+
</ion-header>
150+
<ion-content :fullscreen="true">
151+
<ion-header collapse="condense">
152+
<ion-toolbar>
153+
<ion-title size="large">Photo Gallery</ion-title>
154+
</ion-toolbar>
155+
</ion-header>
156+
157+
<ion-grid>
158+
<ion-row>
159+
<ion-col size="6" :key="photo.filepath" v-for="photo in photos">
160+
<!-- CHANGE: Add a click event listener to each image. -->
161+
<ion-img :src="photo.webviewPath" @click="showActionSheet(photo)"></ion-img>
162+
</ion-col>
163+
</ion-row>
164+
</ion-grid>
165+
166+
<ion-fab vertical="bottom" horizontal="center" slot="fixed">
167+
<ion-fab-button @click="addNewToGallery()">
168+
<ion-icon :icon="camera"></ion-icon>
169+
</ion-fab-button>
170+
</ion-fab>
171+
</ion-content>
172+
</ion-page>
173+
</template>
151174
```
152175

153176
Remember that removing the photo from the `photos` array triggers the `cachePhotos` method for us automatically.

0 commit comments

Comments
 (0)