Start of the trasition to TS
This commit is contained in:
@ -356,4 +356,5 @@
|
||||
</div>
|
||||
</body>
|
||||
<script type="module" src="index.js"></script>
|
||||
<script type="module" src="indexTs.ts"></script>
|
||||
</html>
|
||||
|
@ -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
18
example/indexTs.ts
Normal 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',
|
||||
]
|
||||
})
|
Reference in New Issue
Block a user