rich的灵活应用
效果图
title: {
text: '标题',
left: 'center',
top: '38%',
textStyle: {
color: '#333',
fontSize: 22
},
subtext: `{subtitleBackground| 子标题}`,
subtextStyle: {
color: '#fff',
fontSize: 12,
rich: {
subtitleBackground: {
width: 40,
height: 20,
backgroundColor: this.color, // 设置子标题背景颜色
borderRadius: 14, // 设置子标题背景圆角
padding: [0, 4, 0, 0] // 设置子标题内边距
}
}
},
},
配置手册
- 配置style-name [subtext:
{subtitleBackground| 子标题}] - rich,配置对样的样式