piece
一种块状的入口,可包含图片和文本。常用于展示收件人,例如:邮件收件人或信息收件人。
说明: 从API Version 5 开始支持。
子组件
无
属性
除支持通用属性外,还支持如下属性:
样式
支持通用样式。
说明: 文本和图片默认在整个piece组件中居中。
事件
除支持通用事件外,还支持如下事件:
方法
支持通用方法。
示例
<!-- xxx.hml-->
<div class="container" >
<piece if="{{first}}" content="example"></piece>
<piece if="{{second}}" content="example" closable="true" onclose="closeSecond"></piece>
</div>
/* xxx.css */
.container {
width: 100%;
height: 100%;
align-items: center;
justify-content: center;
}
// xxx.js
export default {
data: {
first: true,
second: true
},
closeSecond(e) {
this.second = false;
}
}