Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Applelo committed Feb 14, 2024
1 parent caa7809 commit 4e21db9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
6 changes: 4 additions & 2 deletions docs/guide/drilldown.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,19 @@ You can change some options from the component.
import { Drilldown } from 'compotes'

const drilldown = new Collapse('#my-drilldown', {
init: true, // [!code focus:4]
init: true, // [!code focus:5]
initAccessibilityAttrs: true,
initEvents: true,
dynamicHeight: false
dynamicHeight: false,
mutationObserver: true,
})
```

- `init` (boolean): Init the component on creation
- `initAccessibilityAttrs` (boolean): Init accessibility attributes on the component
- `initEvents` (boolean): Init events on the component
- `dynamicHeight` (boolean): By default, the height of the drilldown is the tallest menu found. You can set this option to `true` to update the height to the current menu.
- `mutationObserver` (boolean): Use MutationObserver to update component on changes

## Methods

Expand Down
17 changes: 11 additions & 6 deletions docs/guide/dropdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,21 @@ You can change some options from the component.
import { Dropdown } from 'compotes'

const drag = new Drag('.c-drag', {
init: true, // [!code focus:4]
init: true, // [!code focus:6]
initEvents: true,
enforceType: undefined,
openOn: 'click',
equalizeWidth: undefined,
mutationObserver: true,
})
```

- `init` (boolean): Init the component on creation
- `initEvents` (boolean): Init events on the component
- `enforceType` ('default' or 'menu'): The type of the drilldown
- `openOn` ('click' or 'hover'): Open the drilldown on click/hover from the trigger element
- `enforceType` ('default' or 'menu'): The type of the dropdown
- `openOn` ('click' or 'hover'): Open the dropdown on click/hover from the trigger element
- `equalizeWidth` (boolean): Equalize width on the trigger and the container. It will refresh on mutation observer (if enable)
- `mutationObserver` (boolean): Use MutationObserver to update component on changes

## Methods

Expand All @@ -85,9 +89,10 @@ dropdown.init()// [!code focus]
- `initAccessibilityEvents()`: Init component accessibility events
- `destroyEvents()`: Destroy the component events
- `destroy()`: Destroy the component
- `open()`: Open the drilldown
- `toggle()`: Toggle the drilldown
- `close()`: Close the drilldown
- `open()`: Open the dropdown
- `toggle()`: Toggle the dropdown
- `close()`: Close the dropdown
- `equalizeWidth()`: Equalize the width of the container and the trigger of the dropdown

## Data

Expand Down

0 comments on commit 4e21db9

Please sign in to comment.