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

DescriptionTypeDefault

Required

classNameCustomized class.String-No
typeFive status types include success, fail, info, warn and waiting, success by default. StringsuccessNo
titleMain title.String-Yes
subTitleSub title.String-No
mainButtonText of the main button is related with the availability.Object<buttonText, disabled>-No
subButtonText of the auxiliary button is related with the availability.Object<buttonText, disabled>-No
onTapMainClick function of the main button.() => {}-No
onTapSubClick function of the auxiliary button.() => {}-No