Card
Card.
Attribute Name | Description | Type | Default | Mandatory |
thumb | Card thumbnail address | String | false | |
title | Card title | String | true | |
subTitle | Card subtitle | String | false | |
footer | Footer text | String | false | |
footerImg | Footer image address | String | false | |
onCardClick | Callback when the card is clicked | (info: Object) => void | false | |
info | Used to transfer data to the outside when the card is clicked | String | false |
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,
});
}
});