uniapp实现动态的渐变色

2024-03-20  本文已影响0人  我是七月
渐变色
需要在style里面进行添加,但是使用background-color,居然不起作用,不知道为什么😓
最后发现使用background-image可以实现👍🏻
<view :style="{ color: themeColor,backgroundImage: `linear-gradient(to right,${themeBgColor}, ${backgroundRightColor})`,'background-color': themeBgColor  ,height:navbarHeight}">

</view>
成功解决,重写uni-nav-bar实现的顶部导航栏渐变色,下面从左到右的渐变色,两边颜色色值差异不是很大😄
上一篇 下一篇

猜你喜欢

热点阅读