赞
踩
JS方式实现文本或按钮背景渐变色
我们可以参考HarmonyOS linear-gradient
如下是动态设置代码
hml
- <div class="container">
- <text class="title"
- style="background:{
- {mbackground}}">
- {
- { $t('strings.hello') }} {
- { title }}
- </text>
- </div>
css
- .container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 100%;
- background-color: white;
- }
-
- .title {
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。