Card
Card.
Property | Description | Type | Required |
thumb | Card thumbnail address. | String | No |
title | Card title. | String | Yes |
subTitle | Card subtitle. | String | No |
footer | Footer text. | String | No |
footerImg | Footer image address. | String | No |
onCardClick | Callback when the card is clicked. | (info: Object) => void | No |
info | Used to transfer data to the outside when the card is clicked. | String | No |
Example
copy
{
"defaultTitle": "AntUI Component Library",
"usingComponents": {
"card": "mini-antui/es/card/index"
}
}
copy
<card
thumb="{{thumb}}"
title="Card Title"
subTitle="Subtitle is not required"
onClick="onCardClick"
footer="Description"
footerImg="{{footerImg}}"
info="Click the card"
/>
copy
Page({
data: {
thumb: 'https://img.example.com/example.png',
footerImg: 'https://img.example.com/example.png',
},
onCardClick: function(ev) {
my.showToast({
content: ev.info,
});
}
});