22import type {
33 CloudinaryUploadWidgetError ,
44 CloudinaryUploadWidgetResults ,
5- } from ' @cloudinary-util/types'
6- import type { MediaType } from ' ../src/runtime/components/CldProductGallery.vue'
5+ } from " @cloudinary-util/types" ;
6+ import type { MediaType } from " ../src/runtime/components/CldProductGallery.vue" ;
77
8- const { url } = useCldImageUrl ({ options: { src: ' /cld-sample-5.jpg' } })
9- console .log (url )
8+ const { url } = useCldImageUrl ({ options: { src: " /cld-sample-5.jpg" } });
9+ console .log (url );
1010
1111const { url : videoUrl } = useCldVideoUrl ({
12- options: { src: ' videos/mountain-stars' },
13- })
14- console .log (videoUrl )
12+ options: { src: " videos/mountain-stars" },
13+ });
14+ console .log (videoUrl );
1515
16- const mediaAssets: { tag: string , mediaType? : MediaType }[] = [
17- { tag: ' electric_car_product_gallery_demo' }, // by default mediaType: "image"
18- { tag: ' electric_car_product_gallery_demo' , mediaType: ' video' },
19- { tag: ' electric_car_360_product_gallery_demo' , mediaType: ' spin' },
20- ]
16+ const mediaAssets: { tag: string ; mediaType? : MediaType }[] = [
17+ { tag: " electric_car_product_gallery_demo" }, // by default mediaType: "image"
18+ { tag: " electric_car_product_gallery_demo" , mediaType: " video" },
19+ { tag: " electric_car_360_product_gallery_demo" , mediaType: " spin" },
20+ ];
2121
22- const buttonId = ' open-btn'
22+ const buttonId = " open-btn" ;
2323
24- const cldVideoRef = ref ()
24+ const cldVideoRef = ref ();
2525
2626const chapters = {
27- 0 : ' Chapter 1' ,
28- 6 : ' Chapter 2' ,
29- 9 : ' Chapter 3' ,
30- }
27+ 0 : " Chapter 1" ,
28+ 6 : " Chapter 2" ,
29+ 9 : " Chapter 3" ,
30+ };
3131
3232const colors = {
33- accent: ' #ff0000' ,
34- base: ' #00ff00' ,
35- text: ' #0000ff' ,
36- }
33+ accent: " #ff0000" ,
34+ base: " #00ff00" ,
35+ text: " #0000ff" ,
36+ };
3737
3838const onResult = (results : CloudinaryUploadWidgetResults ) => {
39- console .log (' results' , results )
40- }
39+ console .log (" results" , results );
40+ };
4141const onError = (
4242 error : CloudinaryUploadWidgetError ,
43- results : CloudinaryUploadWidgetResults ,
43+ results : CloudinaryUploadWidgetResults
4444) => {
45- console .log (' error' , error )
46- console .log (' results' , results )
47- }
45+ console .log (" error" , error );
46+ console .log (" results" , results );
47+ };
4848 </script >
4949
5050<template >
51- <button :id =" buttonId" >
52- Select Image or Video
53- </button >
51+ <button :id =" buttonId" >Select Image or Video</button >
5452 <CldMediaLibrary
5553 api-key="12345"
5654 :button-id =" buttonId "
@@ -83,6 +81,7 @@ const onError = (
8381 chapters-button
8482 :chapters =" chapters "
8583 :colors =" colors "
84+ :transformation =" { raw_transformation: ' e_fade:2000,e_fade:-2000' } "
8685 />
8786 <CldUploadWidget
8887 v-slot =" { open } "
@@ -91,12 +90,7 @@ const onError = (
9190 :on-error =" onError "
9291 :on-result =" onResult "
9392 >
94- <button
95- type =" button"
96- @click =" open"
97- >
98- Upload an Image
99- </button >
93+ <button type =" button" @click =" open" >Upload an Image</button >
10094 </CldUploadWidget >
10195 <CldUploadButton
10296 upload-preset="nuxt-cloudinary-unsigned"
0 commit comments