关于在行内style使用变量动态修改图片,background-size失效这件事

行内写法
:style="{'background': image}"

js中

this.image = 'url(' + res.data.content + ') no-repeat center / 100% 100%'

ps: 其中的’/ 100% 100%’, 就相当于在background属性之后,添加一个background-size: 100% 100%;

 

 


关注公众号,了解更多it技术(it问答网

发表评论

电子邮件地址不会被公开。