Oxpecker有一个特性:复制属性。
1. 首先在define中定义一个组件
head: {
define: {
text: {
tag: {{text-view}}
attrs: {
width: fill
height: 10
textAlign: center
textColor: "#000000"
textSize: 20sp
backgroundColor: "#cccccc"
margin: [0, "1px", 0, 0]
text: "默认内容"
}
}
}
}
2. 之后就可以在body中使用定义的组件了
body: {
{{linear-layout}}: {
orien: v
text: {}
text: {}
text: {}
text: {}
text: {
backgroundColor: "#cc0000"
text: "修改内容"
textAlign: right|bottom
textColor: "#ffffff"
textBold: true
}
}
}