Skip to content

Commit 7964dee

Browse files
authored
Update README.md
1 parent 89007f6 commit 7964dee

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@
1717
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
1818
<script src="../smart-core/source/smart.core.js"></script>
1919
<link rel="stylesheet" href="../smart-core/source/styles/smart.default.css" type="text/css" />
20+
<script>
21+
window.onload = function () {
22+
const basePath = '/images/',
23+
carouselSquare = document.getElementById('carouselSquare'),
24+
25+
carouselSquare.dataSource = generateDataSource(7);
26+
27+
function generateDataSource(items) {
28+
let dataSource = Array(items).fill({});
29+
30+
dataSource.forEach((element, index) => dataSource[index] = { image: `${basePath}carousel-square-${index + 1}.jpg` });
31+
return dataSource;
32+
}
33+
}
34+
</script>
2035
<next-code-block></next-code-block>
2136
</template>
2237
</custom-element-demo>

0 commit comments

Comments
 (0)