0.1.0 • Published 6 years ago
select-widget v0.1.0
Select Widget
Pure functionality, no styles included.
Setup
- Webpack based.
- ES6 as a source.
- Exports in a umd format, runs everywhere.
- ES6 tests with Mocha, Chai and Karma runner.
- Linting with Airbnb eslint
Getting started with Development
npm install
to get the project's dependencies.npm run server
to start development server with live-reload and hot module replacement- go to http://localhost:8080/index.html
Scripts
npm run server
- starts development server with live-reload and hot module replacementnpm run build
- produces production version under thedist
foldernpm run test
- runs tests.
Usage
npm i select-widget
<div class="select"></div>
import Select from 'select-widget';
const select = new Select({
element: document.querySelector('.select'),
data: ['A', 'B', 'C'],
onChange(rawData, selected) {
}
})
select.on('change', (a, b) => console.log(a, b));
see src/examples.js
for more usages.