You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/storage.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ You can access the Firebase Storage from within any component with the composabl
12
12
13
13
You can upload and monitor the progress of a file upload with the `useStorageFile()` composable. This also exposes the URL of the file once it's uploaded and its metadata, let's start with a full example of a form upload:
14
14
15
-
```vue
15
+
```vue{4,?}
16
16
<script setup lang="ts">
17
17
// See https://vueuse.org/core/useFileDialog
18
18
import { useFileDialog } from '@vueuse/core'
@@ -75,11 +75,10 @@ Once the picture is uploaded, you can use the `url` reactive variable. For examp
75
75
76
76
VueFire also exposes a smaller composable that only retrieves the url of a file. This is useful if you don't need to upload a file but only display it:
77
77
78
-
```vue
78
+
```vue{4,?}
79
79
<script setup lang="ts">
80
-
import { useFileDialog } from '@vueuse/core'
81
80
import { ref as storageRef } from 'firebase/storage'
82
-
import { useFirebaseStorage, useStorageFile, useStorageFileUrl } from 'vuefire'
81
+
import { useFirebaseStorage, useStorageFileUrl } from 'vuefire'
The same way you can access the file URL you can also access the file metadata. You can also use the `update()` function to update the metadata and keep the reactive variable up to date:
97
96
98
-
```vue
97
+
```vue{4,?}
99
98
<script setup lang="ts">
100
-
import { useFileDialog } from '@vueuse/core'
101
99
import { ref as storageRef } from 'firebase/storage'
102
100
import { useFirebaseStorage, useStorageFile } from 'vuefire'
0 commit comments