Reputation: 1796
I am a php developer and i am just learning vue. I want to know how can i change the height width of svg image using v-img
tag.
Here is the code
<v-img src="/empty.svg" aspect-ratio="2"></v-img>
The above code hide the image or doesn't seem to be working. Please help me to solve this small issue.
Any solution appreciated!
Upvotes: 3
Views: 2382
Reputation: 4787
aspect-ratio
doesn't change the height/width of the image, but the whole ratio.
If you want to change height or width, use the height
and width
props of v-img
.
<v-img src="/empty.svg" width="500" height="100" />
You can specify only one of these props, and add a desired aspect-ratio
to keep the right ratio. Use contain="true"
to avoid content crop.
https://vuetifyjs.com/en/components/images/
Upvotes: 4