vue-markdown icon indicating copy to clipboard operation
vue-markdown copied to clipboard

Img width not adpat to the parent div

Open Gavin-zsr opened this issue 6 years ago • 2 comments

When the img rendered in the div, its size doesn't adapt to the parent div's width, if this img over the div's width, it will exceed the div. And setting the css is not useful for the img.

Gavin-zsr avatar May 27 '18 04:05 Gavin-zsr

Any news on this? Facing same issue and not sure how to apply extra css to images rendered inside vue-markdown

Appreciate any suggestion.

leosdutra avatar Nov 11 '19 16:11 leosdutra

@leosdutra I had the exact same problem and solved it by removing the scoped attribute from the <style></style> tag in the SFC.

I initally had scoped style in the SFC like this, <style scoped> img { width: 100%; } </style> which translates to img[data-v-<uniq_random_id>] { width: 100%; } However, the component doesn't seem to pass down that id properly to the image element and therefore the style is not applied. Removing the scoped attribute therefore solves it.

Hopefully you have a similar set up and this helps.

A neater solution would be for the component to attach the id to all of its rendered elements, I think.

ZeanQin avatar Nov 20 '19 01:11 ZeanQin