rh-mp-drawer
v0.0.4
Published
rh mp custom drawer
Downloads
8
Readme
custom-drawer
Mini program custom components
Using this component requires the Mini Program Basic Library version 2.2.1 or above, as well as the npm build of the developer tools. Specific details can be found in the official npm documentation.
Instructions
- Install custom-drawer
npm install --save rh-mp-drawer
- Add custom-drawer custom component configuration in page.json of the page that needs to use custom-drawer
{
"usingComponents": {
"custom-drawer": "rh-mp-drawer"
}
}
- Reference: WXML and js slide-view
<custom-drawer show="{{showCustomModal}}" direction="top">
<view>Drawer Content Here</view>
</custom-drawer>
<button bindtap="openCustomDrawer">CustomDrawer</button>
Page({
openCustomDrawer() {
this.setData({showCustomModal: true})
},
})
slide-view, The properties:
show
- Type:
Boolean
- Description: Determines whether the drawer is visible or hidden.
- Default:
false
direction
- Type:
String
- Description: Specifies the direction from which the drawer slides in.
- Possible values:
'bottom'
,'top'
,'left'
,'right'
- Default:
'bottom'