1
1
<script lang="ts" setup>
2
2
// Usage of `useCldImageUrl` composable
3
- const { url } = useCldImageUrl ({ options: { src: " /cld-sample-5.jpg" } });
4
- console .log (url );
3
+ const { url } = useCldImageUrl ({ options: { src: ' /cld-sample-5.jpg' } })
4
+ console .log (url )
5
5
6
6
const { url : videoUrl } = useCldVideoUrl ({
7
- options: { src: " videos/mountain-stars" },
8
- });
9
- console .log (videoUrl );
7
+ options: { src: ' videos/mountain-stars' },
8
+ })
9
+ console .log (videoUrl )
10
10
11
11
const mediaAssets = [
12
- { tag: " electric_car_product_gallery_demo" }, // by default mediaType: "image"
13
- { tag: " electric_car_product_gallery_demo" , mediaType: " video" },
14
- { tag: " electric_car_360_product_gallery_demo" , mediaType: " spin" },
15
- ];
12
+ { tag: ' electric_car_product_gallery_demo' }, // by default mediaType: "image"
13
+ { tag: ' electric_car_product_gallery_demo' , mediaType: ' video' },
14
+ { tag: ' electric_car_360_product_gallery_demo' , mediaType: ' spin' },
15
+ ]
16
16
17
- const buttonId = " open-btn" ;
17
+ const buttonId = ' open-btn'
18
18
19
- const cldVideoRef = ref ();
19
+ const cldVideoRef = ref ()
20
20
21
21
const chapters = {
22
- 0 : " Chapter 1" ,
23
- 6 : " Chapter 2" ,
24
- 9 : " Chapter 3" ,
25
- };
22
+ 0 : ' Chapter 1' ,
23
+ 6 : ' Chapter 2' ,
24
+ 9 : ' Chapter 3' ,
25
+ }
26
26
27
27
const colors = {
28
- accent: " #ff0000" ,
29
- base: " #00ff00" ,
30
- text: " #0000ff" ,
31
- };
28
+ accent: ' #ff0000' ,
29
+ base: ' #00ff00' ,
30
+ text: ' #0000ff' ,
31
+ }
32
32
</script >
33
33
34
34
<template >
35
- <button :id =" buttonId" >Select Image or Video</button >
35
+ <button :id =" buttonId" >
36
+ Select Image or Video
37
+ </button >
36
38
<CldMediaLibrary
37
39
api-key =" 12345"
38
40
:button-id =" buttonId"
@@ -43,7 +45,10 @@ const colors = {
43
45
cloud-name =" demo"
44
46
:button-id =" buttonId"
45
47
/>
46
- <CldOgImage src =" cld-sample-2" twitter-title =" test" />
48
+ <CldOgImage
49
+ src =" cld-sample-2"
50
+ twitter-title =" test"
51
+ />
47
52
<CldVideoPlayer
48
53
ref =" cldVideoRef"
49
54
width =" 1620"
@@ -60,7 +65,12 @@ const colors = {
60
65
upload-preset =" nuxt-cloudinary-unsigned"
61
66
:tags =" ['sad', 'music']"
62
67
>
63
- <button type =" button" @click =" open" >Upload an Image</button >
68
+ <button
69
+ type =" button"
70
+ @click =" open"
71
+ >
72
+ Upload an Image
73
+ </button >
64
74
</CldUploadWidget >
65
75
<CldUploadButton upload-preset =" nuxt-cloudinary-unsigned" >
66
76
Upload
0 commit comments