
微信小程序里如何修改CSS的样式呢,其实跟在WEB端很相似,只是换了个方法而已。
document.getElementById(id).style.property = new style
element.style.PRoperty = new style
这种方法(使用会报错,没定义)
正确方法:
<text style="color:{{color}}">变色</text> // 元素样式使用内联式样式法,属性值使用微信提供的特殊表达式符号。 this.setdata({ color: "green" })








网友评论文明上网理性发言 已有0人参与
发表评论: