docs(): update examples and usage

This commit is contained in:
mhartington
2018-05-31 10:56:02 -04:00
parent 89a7d169e9
commit 5ad35ccc00
25 changed files with 370 additions and 225 deletions

View File

@ -5,19 +5,20 @@ import { Component, Listen, Prop, State } from '@stencil/core';
styleUrl: 'menu-toggle.scss'
})
export class MenuToggle {
@Prop({ context: 'document' }) doc!: Document;
@Prop({ context: 'document' })
doc!: Document;
@State() visible = false;
/**
* Optional property that maps to a Menu's `menuId` prop. Can also be `left` or `right` for the menu side. This is used to find the correct menu to toggle
* Optional property that maps to a Menu's `menuId` prop.
* Can also be `left` or `right` for the menu side.
* This is used to find the correct menu to toggle
*/
@Prop() menu?: string;
/**
* Automatically hides the content when the corresponding menu is not
* active
* Automatically hides the content when the corresponding menu is not active
*/
@Prop() autoHide = true;
@ -54,15 +55,16 @@ export class MenuToggle {
hostData() {
const hidden = this.autoHide && !this.visible;
return {
class: {
class: {
'menu-toggle-hidden': hidden
}
};
}
}
function getMenuController(doc: Document): Promise<HTMLIonMenuControllerElement|null> {
function getMenuController(
doc: Document
): Promise<HTMLIonMenuControllerElement | null> {
const menuControllerElement = doc.querySelector('ion-menu-controller');
if (!menuControllerElement) {
return Promise.resolve(null);

View File

@ -1,5 +1,5 @@
# ion-menu-toggle
The MenuToggle component can be used to toggle a menu open or closed.
<!-- Auto Generated Below -->