0.1.0 • Published 8 years ago
@rebelcode/vc-toggleable
Licence
MIT
Version
0.1.0
Deps
0
Size
178 kB
Vulns
0
Weekly
0
Toggleable Component
Usage
<toggle :toggleable="toggleable" inline-template>
<span @click="setState(!isOn)">
{{ isOn ? 'On' : 'Off' }}
</span>
</toggle>
Toggleable component implements logic responsible for getting Toggle model state and setting it. So consumer needs to use inline-template. Inside that template next functions and variables available:
setState({boolean} newState) - set toggle model state
isOn - is toggle model state set to true
Also, toggleable property receives object, instance of FunctionalToggleable
Developing
Run npm install to install all dev dependencies.
Here is available npm commands.
Build library while developing
npm run dev
Build library for production
npm run production
Run e2e tests
npm run e2e