Constructor
new exports(dataObjectopt, optionsopt)
Parameters:
Name |
Type |
Attributes |
Default |
Description |
dataObject |
DataModel
|
<optional>
|
null
|
|
options |
Object
|
<optional>
|
|
Properties
Name |
Type |
Attributes |
Default |
Description |
image |
string
|
<optional>
|
null
|
a URL to an image |
dataField |
string
|
<optional>
|
null
|
the field name in the DataObject that holds the URL to an image |
title |
string
|
<optional>
|
null
|
a string to use as a title |
titleField |
string
|
<optional>
|
|
the field name in the DataObject that holds the title of the image |
captionField |
string
|
<optional>
|
|
the field name in the dataObject that holds the caption |
|
- Source:
Example
Use a DataModel to drive the image card.
const model = new DataModel({
image: '//static/image.png',
name: 'Great Image',
description: 'You will love it'
})
const imageCardComponent = new ImageCardComponent(model, {
dataField: 'image',
titleField: 'name',
captionField: 'description'
})