This section describes the message.
Property | Description | Type | Default value | Mandatory |
---|---|---|---|---|
className | Custom class | String | - | false |
type | The messages can be divided into five types, success, fail, info, warn, waiting, and info. The default type is success | String | success | false |
title | The title | String | - | true |
subTitle | Subtitle | String | - | false |
mainButton | Text and relevant availability of the main button | Object<buttonText, disabled> | - | false |
subButton | Text and relevant availability of the secondary button | Object<buttonText, disabled> | - | false |
onTapMain | Click function of the main button | () => {} | - | false |
onTapSub | Click function of the secondary button | () => {} | - | false |
Sample code
{
"defaultTitle": "AntUI component library of the Mini Program",
"usingComponents": {
"message": "mini-antui/es/message/index"
}
}
<view>
<message
title="{{title}}"
subTitle="{{subTitle}}"
type="success"
mainButton="{{messageButton.mainButton}}"
subButton="{{messageButton.subButton}}"
onTapMain="goBack">
</message>
</view>
Page({
data: {
title: "Operation succeeded",
subTitle: "The content details can be folded. No more than two lines is recommended",
messageButton: {
mainButton: {
buttonText: "Main operation"
},
subButton: {
buttonText: "Auxiliary operation"
}
}
},
goBack() {
my.navigateBack();
}
});