Stretch image in iron-image element

后端 未结 4 1078
北恋
北恋 2021-01-23 06:51

I have an element inside a div :

. The image is 315px in width
4条回答
  •  时光说笑
    2021-01-23 07:15

    I also wanted to update "img" tag style which is "under" (=shadow DOM) the iron-image.

    To do so I have updated the style, here is the dart code:

    querySelectorAll('img').forEach((Element img) {
    img.setAttribute('style', 'width:330px;height:auto');
    });
    

    This code is placed within the PolymerElement "attached" available function (wouldn't work in the "ready" function)

    attached Called after the element is attached to the document.

提交回复
热议问题