How to set base path in mounted function in vue js ?
-
How to set base path in mounted function in vue js ?
My code : -
mounted () {
if(this.image.id && this.image.url) {
console.log(this.image);
this.imageData ='http://localhost/bagisto/storage/app/public/'+this.image.path;
}
},i want to set dynamic url. i had tried "{{url()->to('/')}".....but its now working.Please tell me that how can i set dynamic url ?
Thanks
-
There can be two options, either you can set path in window object and fetch in mounted method or you could pass attribute in script tag.