@smarthtmlelements/smart-carousel
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "@smarthtmlelements/smart-carousel", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Smart Carousel", | ||
@@ -22,3 +22,3 @@ "scripts": { | ||
"@webcomponents/webcomponentsjs": "^1.0.22", | ||
"@smarthtmlelements/smart-core": "^2.0.0" | ||
"@smarthtmlelements/smart-core": "^2.0.1" | ||
}, | ||
@@ -25,0 +25,0 @@ "main": "index.js", |
@@ -20,2 +20,17 @@ [](https://www.webcomponents.org/element/htmlelements/smart-carousel) | ||
<link rel="stylesheet" href="../smart-core/source/styles/smart.default.css" type="text/css" /> | ||
<script> | ||
window.onload = function () { | ||
const basePath = '/images/', | ||
carouselSquare = document.getElementById('carouselSquare'), | ||
carouselSquare.dataSource = generateDataSource(7); | ||
function generateDataSource(items) { | ||
let dataSource = Array(items).fill({}); | ||
dataSource.forEach((element, index) => dataSource[index] = { image: `${basePath}carousel-square-${index + 1}.jpg` }); | ||
return dataSource; | ||
} | ||
} | ||
</script> | ||
<next-code-block></next-code-block> | ||
@@ -22,0 +37,0 @@ </template> |
3784206
94