<div class="note" :style ="note"></div>
export default {
data() {
return {
// 这里做法是直接双向绑定整个style,当然你想只双向绑定src属性也是一样的做法
note: {
//这里要这样写
backgroundImage: "url(" + require("../../assets/save.png") + ")",
backgroundRepeat: "no-repeat",
backgroundSize: "25px auto",
marginTop: "5px",
},
}
},
vue项目 背景图 属性双向绑定data里数据的方法
猜你喜欢
转载自blog.csdn.net/qq_39051175/article/details/100701296
今日推荐
周排行