Message
Result page.
Sample Code
copy
// API-DEMO page/component/message/message.json
{
"defaultTitle": "Mini Program AntUI component library",
"usingComponents": {
"message": "mini-antui/es/message/index"
}
}
copy
<!-- API-DEMO page/component/message/message.axml -->
<view>
<message
title="{{title}}"
subTitle="{{subTitle}}"
type="success"
mainButton="{{messageButton.mainButton}}"
subButton="{{messageButton.subButton}}"
onTapMain="goBack">
</message>
</view>
copy
// API-DEMO page/component/message/message.js
Page({
data: {
title: "Operation succeeded",
subTitle: "Content details can be wrapped. Up to two lines are recommended",
messageButton: {
mainButton: {
buttonText: "Main operation"
},
subButton: {
buttonText: "Auxiliary operation"
}
}
},
goBack() {
my.navigateBack();
}
});
Attributes
Property | Description | Type | Default | Required |
className | Customized class. | String | - | No |
type | Five status types include success, fail, info, warn and waiting, success by default. | String | success | No |
title | Main title. | String | - | Yes |
subTitle | Sub title. | String | - | No |
mainButton | Text of the main button is related with the availability. | Object<buttonText, disabled> | - | No |
subButton | Text of the auxiliary button is related with the availability. | Object<buttonText, disabled> | - | No |
onTapMain | Click function of the main button. | () => {} | - | No |
onTapSub | Click function of the auxiliary button. | () => {} | - | No |