0👍
✅
Done, finally by editing the path in the resource to be
return [
'data' => [
'type' => 'user-images',
'user-image-id' => $this->id,
'attributes' => [
'path' => url('storage/'.$this->path),
'width' => $this->width,
'height' => $this->height,
'location' => $this->location,
]
],
'links' => [
'self' => url('/users/'.$this->user_id)
]
];
0👍
this might happen, the data is not present when component is rendered, after data load component should rerender, try one of the two approaches,
1.
<img v-if="imageObject"
:src="imageObject.data.attributes.path"
:class="classes"
ref="userImage"
:alt="alt"
>
2.
<img :key="imageObject.data.attributes.path"
:src="imageObject.data.attributes.path"
:class="classes"
ref="userImage"
:alt="alt"
>
Source:stackexchange.com