Constructor
new CardComponent(optionsopt)
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
Example
const model = new DataModel({
name: 'Pimsler Particle',
description: 'This can decrease the distance between molecules.',
image: '/static/image.jpeg'
})
const cardComponent = new CardComponent(
model,
{ titleField: 'name', captionField: 'description' }
)
// Add an image as an example (though we'd really use ImageCardComponent for this)
cardComponent.mainComponent.append(
new ImageComponent(
model,
{ dataField: 'image' }
)
)
Members
_mainComponent
the main content, like an image or video
captionComponent :Component
The Component in which we display the caption of the card
Type:
mainComponent :Component
The Component in which we display the main content, like an image or video
Type:
titleComponent :Component
The Component in which we display the title of the card