vant 很多组件带自定义样式custom-class,方便使用者修改或者扩展。
本文以vant-cell修改背景色为例,说明自定义属性的使用。
一、vant外部样式说明和vant-cell自定义属性说明


二、引入cell组件及原始样式
xml引入vant-cell

原始效果如下图

三、使用custom-class属性修改cell的背景底色
xml申明custom-class属性

wxss实现具体的样式

效果如下图,背景色样式已经被修改了,

vant 很多组件带自定义样式custom-class,方便使用者修改或者扩展。
本文以vant-cell修改背景色为例,说明自定义属性的使用。
xml引入vant-cell
原始效果如下图
xml申明custom-class属性
wxss实现具体的样式
效果如下图,背景色样式已经被修改了,
本文标题:微信小程序之vant组件自定义样式(外部样式)
本文链接:https://www.haomeiwen.com/subject/advhurtx.html
网友评论