piece
An entrance piece that can contain images and text. It is usually used to display receivers, for example, email recipients or message recipients.
Child Component
None
Attributes
In addition to the attributes in Universal Attributes, the following attributes are supported.
Styles
Styles in Universal Styles are supported.
NOTE: By default, text and images are placed in the middle of the <piece> component.
Events
In addition to the events in Universal Events, the following events are supported.
Triggered when users click the delete icon of the operational piece. You can delete this component by using the if directive. |
Method
Methods in Universal Methods are supported.
Example
<!-- 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;
}
}