Skip to content

Commit 5bc6bd2

Browse files
committed
docs(vue): remove period at the end of comments
1 parent 34fdce3 commit 5bc6bd2

File tree

12 files changed

+77
-77
lines changed

12 files changed

+77
-77
lines changed

docs/vue/your-first-app.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ import App from './App.vue';
104104
import router from './router';
105105

106106
import { IonicVue } from '@ionic/vue';
107-
// CHANGE: Add the following import.
107+
// CHANGE: Add the following import
108108
import { defineCustomElements } from '@ionic/pwa-elements/loader';
109109

110110
/* Ionic styles are not shown in this example to keep it brief but will be included in the Ionic package downloaded for your app. Do not remove them. */
@@ -207,7 +207,7 @@ We put the visual aspects of our app into `<ion-content>`. In this case, it’s
207207
<script setup lang="ts">
208208
// CHANGE: Add import from `ionicons/icons`
209209
import { camera, trash, close } from 'ionicons/icons';
210-
// CHANGE: Update import from `@ionic/vue` to include necessary Ionic components.
210+
// CHANGE: Update import from `@ionic/vue` to include necessary Ionic components
211211
import {
212212
IonPage,
213213
IonHeader,
@@ -222,7 +222,7 @@ import {
222222
IonCol,
223223
IonImg,
224224
} from '@ionic/vue';
225-
// CHANGE: Remove or comment out the ExploreContainer import.
225+
// CHANGE: Remove or comment out the ExploreContainer import
226226
// import ExploreContainer from '@/components/ExploreContainer.vue';
227227
</script>
228228
```
@@ -258,7 +258,7 @@ Next, open `src/views/TabsPage.vue`. Change the label to "Photos" and the `ellip
258258
259259
<script setup lang="ts">
260260
import { IonTabBar, IonTabButton, IonTabs, IonLabel, IonIcon, IonPage, IonRouterOutlet } from '@ionic/vue';
261-
// CHANGE: Update import by removing `ellipse` and adding `images`.
261+
// CHANGE: Update import by removing `ellipse` and adding `images`
262262
import { images, square, triangle } from 'ionicons/icons';
263263
</script>
264264
```

docs/vue/your-first-app/2-taking-photos.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ import {
8989
IonImg,
9090
} from '@ionic/vue';
9191
92-
// CHANGE: Add `usePhotoGallery` import.
92+
// CHANGE: Add `usePhotoGallery` import
9393
import { usePhotoGallery } from '@/composables/usePhotoGallery';
9494
95-
// CHANGE: Destructure `addNewToGallery` from `usePhotoGallery().
95+
// CHANGE: Destructure `addNewToGallery` from `usePhotoGallery()
9696
const { addNewToGallery } = usePhotoGallery();
9797
</script>
9898
```
@@ -114,7 +114,7 @@ export const usePhotoGallery = () => {
114114
// ...existing code...
115115
};
116116

117-
// CHANGE: Add the `UserPhoto` interface.
117+
// CHANGE: Add the `UserPhoto` interface
118118
export interface UserPhoto {
119119
filepath: string;
120120
webviewPath?: string;
@@ -125,7 +125,7 @@ Above the `addNewToGallery()` method, define an array of `UserPhoto`, which will
125125

126126
```ts
127127
export const usePhotoGallery = () => {
128-
// CHANGE: Add the `photos` array.
128+
// CHANGE: Add the `photos` array
129129
const photos = ref<UserPhoto[]>([]);
130130

131131
// ...existing code...
@@ -146,21 +146,21 @@ export const usePhotoGallery = () => {
146146
quality: 100,
147147
});
148148

149-
// CHANGE: Create the `fileName` with current timestamp.
149+
// CHANGE: Create the `fileName` with current timestamp
150150
const fileName = Date.now() + '.jpeg';
151-
// CHANGE: Create `savedImageFile` matching `UserPhoto` interface.
151+
// CHANGE: Create `savedImageFile` matching `UserPhoto` interface
152152
const savedImageFile = {
153153
filepath: fileName,
154154
webviewPath: capturedPhoto.webPath,
155155
};
156156

157-
// CHANGE: Update the `photos` array with the new photo.
157+
// CHANGE: Update the `photos` array with the new photo
158158
photos.value = [savedImageFile, ...photos.value];
159159
};
160160

161161
return {
162162
addNewToGallery,
163-
// CHANGE: Update return statement to include `photos` array.
163+
// CHANGE: Update return statement to include `photos` array
164164
photos,
165165
};
166166
};
@@ -261,7 +261,7 @@ import {
261261
262262
import { usePhotoGallery } from '@/composables/usePhotoGallery';
263263
264-
// CHANGE: Add `photos` array to destructure from `usePhotoGallery()`.
264+
// CHANGE: Add `photos` array to destructure from `usePhotoGallery()`
265265
const { photos, addNewToGallery } = usePhotoGallery();
266266
</script>
267267
```

docs/vue/your-first-app/3-saving-photos.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { Preferences } from '@capacitor/preferences';
2626
export const usePhotoGallery = () => {
2727
// ...existing code...
2828

29-
// CHANGE: Add the `savePicture()` method.
29+
// CHANGE: Add the `savePicture()` method
3030
const savePicture = async (photo: Photo, fileName: string): Promise<UserPhoto> => {
3131
return {
3232
filepath: 'soon...',
@@ -57,7 +57,7 @@ import { Preferences } from '@capacitor/preferences';
5757
export const usePhotoGallery = () => {
5858
// ...existing code...
5959

60-
// CHANGE: Update the `addNewToGallery()` method.
60+
// CHANGE: Update the `addNewToGallery()` method
6161
const addNewToGallery = async () => {
6262
// Take a photo
6363
const capturedPhoto = await Camera.getPhoto({
@@ -67,14 +67,14 @@ export const usePhotoGallery = () => {
6767
});
6868

6969
const fileName = Date.now() + '.jpeg';
70-
// CHANGE: Add `savedImageFile`.
70+
// CHANGE: Add `savedImageFile`
7171
// Save the picture and add it to photo collection
7272
const savedImageFile = await savePicture(capturedPhoto, fileName);
7373

7474
photos.value = [savedImageFile, ...photos.value];
7575
};
7676

77-
// CHANGE: Add `savePicture()` method.
77+
// CHANGE: Add `savePicture()` method
7878
const savePicture = async (photo: Photo, fileName: string): Promise<UserPhoto> => {
7979
return {
8080
filepath: 'soon...',
@@ -109,7 +109,7 @@ import { Preferences } from '@capacitor/preferences';
109109
export const usePhotoGallery = () => {
110110
// ...existing code...
111111

112-
// CHANGE: Update the `savePicture()` method.
112+
// CHANGE: Update the `savePicture()` method
113113
const savePicture = async (photo: Photo, fileName: string): Promise<UserPhoto> => {
114114
// Fetch the photo, read as a blob, then convert to base64 format
115115
const response = await fetch(photo.webPath!);
@@ -130,7 +130,7 @@ export const usePhotoGallery = () => {
130130
};
131131
};
132132

133-
// CHANGE: Add `convertBlobToBase64()` method.
133+
// CHANGE: Add `convertBlobToBase64()` method
134134
const convertBlobToBase64 = (blob: Blob) => {
135135
return new Promise((resolve, reject) => {
136136
const reader = new FileReader();

docs/vue/your-first-app/4-loading-photos.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Open `usePhotoGallery.ts` and begin by defining a constant variable that will ac
2323
export const usePhotoGallery = () => {
2424
const photos = ref<UserPhoto[]>([]);
2525

26-
// CHANGE: Add a key for photo storage.
26+
// CHANGE: Add a key for photo storage
2727
const PHOTO_STORAGE = 'photos';
2828

2929
// ...existing code...
@@ -36,7 +36,7 @@ Next, at the end of the `usePhotoGallery()` method, add a call to the `cachePhot
3636
export const usePhotoGallery = () => {
3737
// ...existing code...
3838

39-
// CHANGE: Add `cachePhotos()` method.
39+
// CHANGE: Add `cachePhotos()` method
4040
const cachePhotos = () => {
4141
Preferences.set({
4242
key: PHOTO_STORAGE,
@@ -59,7 +59,7 @@ Add the call to the `watch()` method above the return statement in `usePhotoGall
5959
export const usePhotoGallery = () => {
6060
// ...existing code...
6161

62-
// CHANGE: Add call to `watch` with `photos` array and `cachePhotos` method.
62+
// CHANGE: Add call to `watch` with `photos` array and `cachePhotos` method
6363
watch(photos, cachePhotos);
6464

6565
return {
@@ -75,7 +75,7 @@ With the photo array data saved, create a new method in the `usePhotoGallery()`
7575
export const usePhotoGallery = () => {
7676
// ...existing code...
7777

78-
// CHANGE: Add `loadSaved()` method.
78+
// CHANGE: Add `loadSaved()` method
7979
const loadSaved = async () => {
8080
const photoList = await Preferences.get({ key: PHOTO_STORAGE });
8181
const photosInPreferences = photoList.value ? JSON.parse(photoList.value) : [];
@@ -96,12 +96,12 @@ On mobile (coming up next!), we can directly set the source of an image tag - `<
9696
export const usePhotoGallery = () => {
9797
// ...existing code...
9898

99-
// CHANGE: Update `loadSaved()` method.
99+
// CHANGE: Update `loadSaved()` method
100100
const loadSaved = async () => {
101101
const photoList = await Preferences.get({ key: PHOTO_STORAGE });
102102
const photosInPreferences = photoList.value ? JSON.parse(photoList.value) : [];
103103

104-
// CHANGE: Display the photo by reading into base64 format.
104+
// CHANGE: Display the photo by reading into base64 format
105105
for (const photo of photosInPreferences) {
106106
const file = await Filesystem.file({
107107
path: photo.filepath,
@@ -298,7 +298,7 @@ export const usePhotoGallery = () => {
298298
photos.value = photosInPreferences;
299299
};
300300

301-
// CHANGE: Add call to `onMounted()` with the `loadSaved()` method.
301+
// CHANGE: Add call to `onMounted()` with the `loadSaved()` method
302302
onMounted(loadSaved);
303303
watch(photos, cachePhotos);
304304

docs/vue/your-first-app/5-adding-mobile.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { ref, onMounted, watch } from 'vue';
2626
import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera';
2727
import { Filesystem, Directory } from '@capacitor/filesystem';
2828
import { Preferences } from '@capacitor/preferences';
29-
// CHANGE: Add imports.
29+
// CHANGE: Add imports
3030
import { isPlatform } from '@ionic/vue';
3131
import { Capacitor } from '@capacitor/core';
3232

@@ -40,11 +40,11 @@ First, we’ll update the photo saving functionality to support mobile. In the `
4040
Update `savePicture()` to look like the following:
4141

4242
```ts
43-
// CHANGE: Update the `savePicture()` method.
43+
// CHANGE: Update the `savePicture()` method
4444
const savePicture = async (photo: Photo, fileName: string): Promise<UserPhoto> => {
4545
let base64Data: string | Blob;
4646

47-
// CHANGE: Add platform check.
47+
// CHANGE: Add platform check
4848
// "hybrid" will detect mobile - iOS or Android
4949
if (isPlatform('hybrid')) {
5050
const file = await Filesystem.readFile({
@@ -82,11 +82,11 @@ import { Capacitor } from '@capacitor/core';
8282
Then update `savePicture()` to look like the following:
8383

8484
```ts
85-
// CHANGE: Update `savePicture()` method.
85+
// CHANGE: Update `savePicture()` method
8686
const savePicture = async (photo: Photo, fileName: string): Promise<UserPhoto> => {
8787
let base64Data: string | Blob;
8888

89-
// CHANGE: Add platform check.
89+
// CHANGE: Add platform check
9090
// "hybrid" will detect mobile - iOS or Android
9191
if (isPlatform('hybrid')) {
9292
const file = await Filesystem.readFile({
@@ -106,7 +106,7 @@ const savePicture = async (photo: Photo, fileName: string): Promise<UserPhoto> =
106106
directory: Directory.Data,
107107
});
108108

109-
// CHANGE: Add platform check.
109+
// CHANGE: Add platform check
110110
if (isPlatform('hybrid')) {
111111
// Display the new image by rewriting the 'file://' path to HTTP
112112
return {
@@ -127,12 +127,12 @@ const savePicture = async (photo: Photo, fileName: string): Promise<UserPhoto> =
127127
Next, add a new bit of logic in the `loadSaved()` method. On mobile, we can directly point to each photo file on the Filesystem and display them automatically. On the web, however, we must read each image from the Filesystem into base64 format. This is because the Filesystem API uses [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) under the hood. Update the `loadSaved()` method:
128128

129129
```ts
130-
// CHANGE: Update `loadSaved` method.
130+
// CHANGE: Update `loadSaved` method
131131
const loadSaved = async () => {
132132
const photoList = await Preferences.get({ key: PHOTO_STORAGE });
133133
const photosInPreferences = photoList.value ? JSON.parse(photoList.value) : [];
134134

135-
// CHANGE: Add platform check.
135+
// CHANGE: Add platform check
136136
// If running on the web...
137137
if (!isPlatform('hybrid')) {
138138
for (const photo of photosInPreferences) {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import { Capacitor } from '@capacitor/core';
4848
export const usePhotoGallery = () => {
4949
// ...existing code...
5050

51-
// CHANGE: Add `deletePhoto()` method.
51+
// CHANGE: Add `deletePhoto()` method
5252
const deletePhoto = async (photo: UserPhoto) => {
5353
// Remove this photo from the Photos reference data array
5454
photos.value = photos.value.filter((p) => p.filepath !== photo.filepath);
@@ -67,7 +67,7 @@ export const usePhotoGallery = () => {
6767
return {
6868
photos,
6969
addNewToGallery,
70-
// CHANGE: Add `deletePhoto()` to the return statement.
70+
// CHANGE: Add `deletePhoto()` to the return statement
7171
deletePhoto,
7272
};
7373
};
@@ -98,18 +98,18 @@ import {
9898
IonRow,
9999
IonCol,
100100
IonImg,
101-
// CHANGE: Add the `actionSheetController` import.
101+
// CHANGE: Add the `actionSheetController` import
102102
actionSheetController,
103103
} from '@ionic/vue';
104104
105-
// CHANGE: Add `UserPhoto` type import.
105+
// CHANGE: Add `UserPhoto` type import
106106
import type { UserPhoto } from '@/composables/usePhotoGallery';
107107
import { usePhotoGallery } from '@/composables/usePhotoGallery';
108108
109-
// CHANGE: Add `deletePhoto()` method.
109+
// CHANGE: Add `deletePhoto()` method
110110
const { photos, addNewToGallery, deletePhoto } = usePhotoGallery();
111111
112-
// CHANGE: Add `showActionSheet()` method.
112+
// CHANGE: Add `showActionSheet()` method
113113
const showActionSheet = async (photo: UserPhoto) => {
114114
const actionSheet = await actionSheetController.create({
115115
header: 'Photos',

versioned_docs/version-v7/vue/your-first-app.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ import App from './App.vue';
104104
import router from './router';
105105

106106
import { IonicVue } from '@ionic/vue';
107-
// CHANGE: Add the following import.
107+
// CHANGE: Add the following import
108108
import { defineCustomElements } from '@ionic/pwa-elements/loader';
109109

110110
/* Ionic styles are not shown in this example to keep it brief but will be included in the Ionic package downloaded for your app. Do not remove them. */
@@ -207,7 +207,7 @@ We put the visual aspects of our app into `<ion-content>`. In this case, it’s
207207
<script setup lang="ts">
208208
// CHANGE: Add import from `ionicons/icons`
209209
import { camera, trash, close } from 'ionicons/icons';
210-
// CHANGE: Update import from `@ionic/vue` to include necessary Ionic components.
210+
// CHANGE: Update import from `@ionic/vue` to include necessary Ionic components
211211
import {
212212
IonPage,
213213
IonHeader,
@@ -222,7 +222,7 @@ import {
222222
IonCol,
223223
IonImg,
224224
} from '@ionic/vue';
225-
// CHANGE: Remove or comment out the ExploreContainer import.
225+
// CHANGE: Remove or comment out the ExploreContainer import
226226
// import ExploreContainer from '@/components/ExploreContainer.vue';
227227
</script>
228228
```
@@ -258,7 +258,7 @@ Next, open `src/views/TabsPage.vue`. Change the label to "Photos" and the `ellip
258258
259259
<script setup lang="ts">
260260
import { IonTabBar, IonTabButton, IonTabs, IonLabel, IonIcon, IonPage, IonRouterOutlet } from '@ionic/vue';
261-
// CHANGE: Update import by removing `ellipse` and adding `images`.
261+
// CHANGE: Update import by removing `ellipse` and adding `images`
262262
import { images, square, triangle } from 'ionicons/icons';
263263
</script>
264264
```

0 commit comments

Comments
 (0)