1.0.0 • Published 8 years ago

oni.accordion v1.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

oni.accordion

###install

  npm install oni.accordion

###how to use

<ms-accordion ms-widget='{data: @data}'></ms-accordion>
<ms-accordion ms-widget="{data: @data, mode: 'nav'}"></ms-accordion>
<ms-accordion ms-widget="{data: @data, isVertical: false}"></ms-accordion>
propdefaulttypedescription
isVerticaltruebooleanthe arrangement of the panels
width100%number or percentthe width of the headerAndContentHeight
headerWidth30numberthe width of the header when component are stretched horizontally
contentWidth400numberthe width of the panel when component are stretched horizontally
headerAndContentHeight200numberthe height of the headerAndContentHeight when component are stretched horizontally
accordionClass""stringthe className of the component root element
currentTriggerClass"oni-state-active"stringthe extra className of the header to highlight when component are stretched
data[]Array<Object>data source, that each item has title and content
mode'caret''caret' or 'nav'in caret mode, head have a mall triangle icon that make panel collapsible; in nav mode, no any icon
multiplefalsebooleanis support to open multiple panels at the same time
triggerType'click''click' or 'mouseenter'use which event to fold the panel
eventopportunitydescription
onBeforeSwitchwhen the user clicks on the header or the mouse hover the headeruse to decide whether to continue the switch panel
onSwitchwhen onBeforeSwitch no invoke preventDefault methoduse to do sth after switching panel