55 <IKImage
66 :publicKey =" publicKey"
77 :urlEndpoint =" urlEndpoint"
8- src =" https://ik.imagekit.io/gqyojxcwzxj/ABC_BV8lzpfOS "
8+ : src =" src "
99 />
1010 <p >Let's transform this once</p >
1111 <IKImage
1212 :publicKey =" publicKey"
1313 :urlEndpoint =" urlEndpoint"
14- src =" https://ik.imagekit.io/gqyojxcwzxj/ABC_BV8lzpfOS "
14+ : src =" src "
1515 v-bind:transformation =" [{height:300,width:400}]"
1616 />
1717 <p >Let's transform this more than once</p >
1818 <IKImage
1919 :publicKey =" publicKey"
2020 :urlEndpoint =" urlEndpoint"
21- path =" /ABC_BV8lzpfOS "
21+ : path =" path "
2222 v-bind:transformation =" [{height:300,width:400},{rotation:90}]"
2323 />
2424
2525 <p >LQIP</p >
2626 <IKImage
2727 :publicKey =" publicKey"
2828 :urlEndpoint =" urlEndpoint"
29- src =" https://ik.imagekit.io/gqyojxcwzxj/ABC_BV8lzpfOS "
29+ : src =" src "
3030 v-bind:lqip =" {active:true,quality:20}"
3131 />
3232
3333 <p >Adding a Image with Context</p >
3434 <IKContext :publicKey =" publicKey" :urlEndpoint =" urlEndpoint" >
35- <IKImage path =" /ABC_BV8lzpfOS " v-bind:transformation =" [{height:300,width:400}]" />
35+ <IKImage : path =" path " v-bind:transformation =" [{height:300,width:400}]" />
3636 </IKContext >
3737 <p >Upload</p >
3838 <IKContext
4747</template >
4848
4949<script >
50- import { IKImage , IKContext , IKUpload } from " imagekit-vue" ;
50+ import { IKImage , IKContext , IKUpload } from " imagekitio-vue" ;
51+
52+ let urlEndpoint= process .env .VUE_APP_URL_ENDPOINT ;
53+ if (urlEndpoint[urlEndpoint .length - 1 ] === " /" )
54+ urlEndpoint = urlEndpoint .slice (0 ,urlEndpoint .length - 1 );
55+
56+ let path = " /default-image.jpg" ;
57+ if (path[0 ] === " /" )
58+ path = path .split (" /" )[1 ];
5159
5260export default {
5361 name: " app" ,
@@ -58,9 +66,11 @@ export default {
5866 },
5967 data () {
6068 return {
61- urlEndpoint: process . env . VUE_APP_URL_ENDPOINT ,
69+ urlEndpoint: urlEndpoint ,
6270 publicKey: process .env .VUE_APP_PUBLIC_KEY ,
63- authenticationEndpoint: process .env .VUE_APP_AUTHENTICATION_ENDPOINT
71+ authenticationEndpoint: process .env .VUE_APP_AUTHENTICATION_ENDPOINT ,
72+ path: path,
73+ src: ` ${ urlEndpoint} /${ path} `
6474 };
6575 }
6676};
0 commit comments