|
| 1 | +# NativeScript-Vue Multi Drawer |
| 2 | + |
| 3 | +A plugin which provides a drawer component that supports multiple drawers. |
| 4 | + |
| 5 | +All drawers are optional, and can be configured individually. |
| 6 | + |
| 7 | +Features: |
| 8 | + * drawers on left, right, top and bottom |
| 9 | + * swipe to open |
| 10 | + * swipe to close |
| 11 | + * tap outside to close |
| 12 | + * progressively dim main content as the drawer is opened |
| 13 | + |
| 14 | + ## Quick Start |
| 15 | + |
| 16 | + ```bash |
| 17 | +$ npm i --save nativescript-vue-multi-drawer |
| 18 | + ``` |
| 19 | + |
| 20 | + |
| 21 | +```diff |
| 22 | +// main.js |
| 23 | +import Vue from 'nativescript-vue' |
| 24 | +... |
| 25 | ++ import MultiDrawer from 'nativescript-vue-multi-drawer' |
| 26 | ++ Vue.use(MultiDrawer) |
| 27 | +``` |
| 28 | + |
| 29 | +Optionally set default options by passing `options` when installing the plugin: |
| 30 | +```js |
| 31 | +Vue.use(MultiDrawer, { |
| 32 | + // override any option here |
| 33 | + // for example enable debug mode |
| 34 | + debug: true |
| 35 | +}) |
| 36 | +``` |
| 37 | + |
| 38 | +```xml |
| 39 | +<MultiDrawer> |
| 40 | + <StackLayout slot="left"> |
| 41 | + <Label text="Im in the left drawer" /> |
| 42 | + </StackLayout> |
| 43 | + <StackLayout slot="right"> |
| 44 | + <Label text="Im in the right drawer" /> |
| 45 | + </StackLayout> |
| 46 | + <StackLayout slot="top"> |
| 47 | + <Label text="Im in the top drawer" /> |
| 48 | + </StackLayout> |
| 49 | + <StackLayout slot="bottom"> |
| 50 | + <Label text="Im in the bottom drawer" /> |
| 51 | + </StackLayout> |
| 52 | + |
| 53 | + <Frame /> <!-- main content goes into the default slot --> |
| 54 | +</MultiDrawer> |
| 55 | +``` |
| 56 | + |
| 57 | +The component will only enable drawers that have contents in them, so if you only need a left and a right side drawer, you can just remove the top and bottom slots and it will work as expected. |
| 58 | + |
0 commit comments