Start of the trasition to TS

This commit is contained in:
MaxOvs
2023-01-05 18:21:10 +03:00
parent 4af10dd476
commit ce3b928635
12 changed files with 733 additions and 48 deletions

View File

@ -356,4 +356,5 @@
</div>
</body>
<script type="module" src="index.js"></script>
<script type="module" src="indexTs.ts"></script>
</html>

View File

@ -2,30 +2,30 @@ import DropDown from '../index';
import './example';
// ------------------------------Обычный селект--------------------
const dropdown = new DropDown({
selector: '.cg-dropdown_one',
placeholder: 'Выберите авто',
lable: 'EXAMPLE',
items: [
'BMW',
{
id: '213sade',
title: 'Opel',
value: 1,
},
'Mersedes',
'MAN',
'Ferari',
],
styles: {
head: {
width: '830px',
},
list: {
width: '824px',
},
},
});
// const dropdown = new DropDown({
// selector: '.cg-dropdown_one',
// placeholder: 'Выберите авто',
// lable: 'EXAMPLE',
// items: [
// 'BMW',
// {
// id: '213sade',
// title: 'Opel',
// value: 1,
// },
// 'Mersedes',
// 'MAN',
// 'Ferari',
// ],
// styles: {
// head: {
// width: '830px',
// },
// list: {
// width: '824px',
// },
// },
// });
// ------------------------------NativeSelect-----------------------
const dropdownNativeSelect = new DropDown({

18
example/indexTs.ts Normal file
View File

@ -0,0 +1,18 @@
import { SGSelect } from "../src/cg-selectTS";
const dropdn = new SGSelect({
selector: '.cg-dropdown_one',
placeholder: 'Выберите авто',
// lable: 'EXAMPLE',
items: [
'BMW',
{
id: '213sade',
title: 'Opel',
value: 'ds',
},
'Mersedes',
'MAN',
'Ferari',
]
})