vue 动态背景图片
在methods新增一个方法styleBg 在data定义一个背景样式styleObject对象styleBg() {var styleObject = {background: "url(" + this.base_url + this.train.image + ")",backgroundSize: "7.5rem" + " " + "4.2rem",backgro...
·
在methods新增一个方法styleBg 在data定义一个背景样式styleObject对象
styleBg() {
var styleObject = {
background: "url(" + this.base_url + this.train.image + ")",
backgroundSize: "7.5rem" + " " + "4.2rem",
backgroundPosition: "top center",
backgroundRepeat: "no-repeat"
};
this.styleObject=styleObject;
},
更多推荐
已为社区贡献9条内容
所有评论(0)